Commit 5a9a620
committed
Fix crash on quit after removing a source (double-free)
MappingManager::removeSource() explicitly called source->~Source(). Because
the destructor is virtual, that ran the full destructor chain on an object
still owned by QSharedPointer (e.g. retained by the undo stack for undo), so
the object was destroyed a second time when the last shared pointer was
released — a double-free that crashed in ~QObject() on quit (and on undo).
It was most visible with Syphon sources, which carry extra state (an
Objective-C client and a queued signal connection), but the bug applied to
any removed source.
Drop the explicit destructor call and let QSharedPointer own the lifetime;
removing the manager's references is enough.1 parent 29869fb commit 5a9a620
1 file changed
Lines changed: 10 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
119 | 119 | | |
120 | 120 | | |
121 | 121 | | |
122 | | - | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
123 | 132 | | |
124 | 133 | | |
125 | 134 | | |
126 | 135 | | |
127 | | - | |
128 | 136 | | |
129 | 137 | | |
130 | 138 | | |
| |||
0 commit comments