forked from BlueQuartzSoftware/SIMPL
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Mitigate crashes during preflight by disconnecting signals/slots. (Bl…
…ueQuartzSoftware#314) Also use an unlimited undo stack size. The AddFilterCommand or the RemoveFilterCommand are part of the UndoStack and are created every time a filter is created or removed from the pipeline. The signal/slot was hooked up using a lambda as the target of the slot. The QUndoStack max undo size was set to 10. After the 10th filter was added to the pipeline, attempting to set a value in the first filter input widget, which would cause a preflight would crash the pipeline. This is because when the 11th filter is added the first "AddFilterCommand" object gets removed from the stack and destroyed. The signal/slots were never disconnected before the object is destroyed. This repercussion is that a signal/slot connection is still going to be executed on a piece of memory will get corrupted by being written over with new allocations as part of the program. The implemented solution is 2 fold: During the destructor of the AddFilterCommand and RemoveFilterCommand we call the disconnectSignalsSlots() function. We also use a QMetaObject::Connection object to store the connection to the lambda and then disconnect the QMetaObject::Connection during the destructor. We also now use an unlimited undo stack. Updates BlueQuartzSoftware#313 Closes BlueQuartzSoftware#313 Fixes BlueQuartzSoftware#313 Signed-off-by: Michael Jackson <[email protected]>
- Loading branch information
1 parent
e4eaca5
commit 4f1ddcf
Showing
9 changed files
with
52 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters