diff options
author | Tim E. Real <termtech@rogers.com> | 2011-10-16 21:35:39 +0000 |
---|---|---|
committer | Tim E. Real <termtech@rogers.com> | 2011-10-16 21:35:39 +0000 |
commit | a65f03f8cefc3e1d2e6b71ace15789fc63795275 (patch) | |
tree | 7d7138e88f4dbd6c1dba3a67618dccf37973888c /muse2/muse/cobject.h | |
parent | b071fa342f72770346e36b3564c9c225d9af791f (diff) |
Fixed crashes reloading songs having open editors. Previous memleak fixes
revealed some problems. Installed bool TopWin::deleting(). It is set true when
closeEvent() is called in any self-deleting TopWins. Used it to make all such
TopWins and their corresponding child canvasses ignore songChanged signals.
Diffstat (limited to 'muse2/muse/cobject.h')
-rw-r--r-- | muse2/muse/cobject.h | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/muse2/muse/cobject.h b/muse2/muse/cobject.h index c1c45039..309d8424 100644 --- a/muse2/muse/cobject.h +++ b/muse2/muse/cobject.h @@ -62,7 +62,8 @@ class TopWin : public QMainWindow ToplevelType type() const { return _type; } static QString typeName(ToplevelType t); - + bool deleting() const { return _isDeleting; } + virtual void readStatus(MusECore::Xml&); virtual void writeStatus(int, MusECore::Xml&) const; @@ -118,6 +119,11 @@ class TopWin : public QMainWindow QByteArray _savedToolbarState; + // Set if close has been called on a TopWin having the WA_DeleteOnClose attribute. + // The TopWins and any children should ignore any signals such as songChanged + // which may cause a crash while deleting. + bool _isDeleting; + void initTopwinState(); private slots: @@ -131,7 +137,7 @@ class TopWin : public QMainWindow void shareToolsAndMenu(bool); void restoreMainwinState(); void storeInitialState() const; - + }; |