octave-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Octave-bug-tracker] [bug #45366] Two objects not cleaning dynamically a


From: Dan Sebald
Subject: [Octave-bug-tracker] [bug #45366] Two objects not cleaning dynamically allocated widgets leading to crash at exit
Date: Sun, 21 Jun 2015 08:10:24 +0000
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:18.0) Gecko/20100101 Firefox/18.0 SeaMonkey/2.15

Follow-up Comment #1, bug #45366 (project octave):

Attached is a patch to fix the bugs--denoted by (bug fix) in the comment
section.  There is also extensive rearranging of the cleanup code.  Basically,
all the saving of settings that was done in destructors was moved to new
member slot functions.  These new slots were then connected as follows:


      // Order is important.  Deleting QSettings must be last.
      connect (qApp, SIGNAL (aboutToQuit ()),
               command_window, SLOT (save_settings ()));
      connect (qApp, SIGNAL (aboutToQuit ()),
               history_window, SLOT (save_settings ()));
      connect (qApp, SIGNAL (aboutToQuit ()),
               file_browser_window, SLOT (save_settings ()));
      connect (qApp, SIGNAL (aboutToQuit ()),
               doc_browser_window, SLOT (save_settings ()));
      connect (qApp, SIGNAL (aboutToQuit ()),
               workspace_window, SLOT (save_settings ()));
      connect (qApp, SIGNAL (aboutToQuit ()),
               this, SLOT (prepare_to_exit ()));
      connect (qApp, SIGNAL (aboutToQuit ()),
               shortcut_manager::instance, SLOT (cleanup_instance ()));
      // QSettings are saved upon deletion (i.e., cleanup_instance)
      connect (qApp, SIGNAL (aboutToQuit ()),
               resource_manager::instance, SLOT (cleanup_instance ()));


One can see by the sequence above that all necessary settings saves are done
(one via prepare_to_exit()), then the shortcut_manager and finally
resource_manager are destroyed.

With these changes there is no longer a need for this route of cleanup:


-      if (instance)
-        singleton_cleanup_list::add (cleanup_instance);


which has been removed.

(file #34281)
    _______________________________________________________

Additional Item Attachment:

File name: octave-destructor_bugs-djs2015jun20.patch Size:20 KB


    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?45366>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]