Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Q
qgroundcontrol
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Valentin Platzgummer
qgroundcontrol
Commits
15dc9237
Commit
15dc9237
authored
Nov 26, 2014
by
Don Gagne
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Guard again deletes not from LinkManager
parent
e3dac790
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
5 deletions
+11
-5
LinkInterface.h
src/comm/LinkInterface.h
+11
-5
No files found.
src/comm/LinkInterface.h
View file @
15dc9237
...
...
@@ -54,7 +54,9 @@ class LinkInterface : public QThread
public:
LinkInterface
()
:
QThread
(
0
)
QThread
(
0
),
_ownedByLinkManager
(
false
),
_deletedByLinkManager
(
false
)
{
// Initialize everything for the data rate calculation buffers.
inDataIndex
=
0
;
...
...
@@ -73,7 +75,9 @@ public:
}
virtual
~
LinkInterface
()
{
emit
this
->
deleteLink
(
this
);
// LinkManager take ownership of Links once they are added to it. Once added to LinkManager
// user LinkManager::deleteLink to remove if necessary/
Q_ASSERT
(
!
_ownedByLinkManager
||
_deletedByLinkManager
);
}
/* Connection management */
...
...
@@ -197,9 +201,6 @@ signals:
void
communicationUpdate
(
const
QString
&
linkname
,
const
QString
&
text
);
/** @brief destroying element */
void
deleteLink
(
LinkInterface
*
const
link
);
protected:
static
const
int
dataRateBufferSize
=
20
;
///< Specify how many data points to capture for data rate calculations.
...
...
@@ -334,6 +335,11 @@ private:
* @return True if connection could be terminated, false otherwise
**/
virtual
bool
_disconnect
(
void
)
=
0
;
bool
_ownedByLinkManager
;
///< true: This link has been added to LinkManager, false: Link not added to LinkManager
bool
_deletedByLinkManager
;
///< true: Link being deleted from LinkManager, false: error, Links should only be deleted from LinkManager
friend
class
LinkManager
;
};
#endif // _LINKINTERFACE_H_
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment