Hi,

I once again decided to update Rosegarden and was immediately greeted
with a crash while loading a song in 18.06. It turns out that
TrackButtons::slotUpdateTracks called by clearModifiedStatus at the end
of RosegardenMainWindow::setDocument still uses the old RosegardenDocument
deleted further up in RosegardenMainWindow::setDocument.

To fix that I tried to set m_doc in TrackButtons::slotNewDocument and
called addObserver(this) on the new Composition. Knowing that the old
Composition at that point no longer exists, I did not try to call
removeObserver on the old Composition. But then I got a crash in one
of the notifiers called by the Composition because one of the
TrackButtons where slotNewDocument is called is destroyed after the
song is loaded and the call to removeObserver in ~TrackButtons is
commented out.

But calling removeObserver from within ~TrackButtons leads to another
crash when Rosegarden in terminated, because there ~Composition is
called before the ~TrackButtons.

All these problems are also reported by Valgrind as invalid read or
invalid write.


I see two ways to fix this mess:
 - either make sure that the TrackButtons are destroyed before the
   RosegardenDocument is destroyed

 - or allow TrackButtons to release the RosegardenDocument, f.ex.
   by calling slotNewDocument with NULL. TrackButtons would
   then also need lots of checks for m_doc == NULL.


Best regards,

  Daniel


_______________________________________________
Rosegarden-devel mailing list
Rosegarden-devel@lists.sourceforge.net - use the link below to unsubscribe
https://lists.sourceforge.net/lists/listinfo/rosegarden-devel

Reply via email to