Bug report #3531

Bug: QgisApp instance never delete

Added by 05092009 - about 13 years ago. Updated about 13 years ago.

Assignee:nobody -
Affected QGIS version: Regression?:No
Operating System:All Easy fix?:No
Pull Request or Patch supplied: Resolution:fixed
Crashes QGIS or corrupts data: Copied to github as #:13591


By the time application finishes, QgisApp instance won't be deleted.
It happens, because it's constructor is never called.
Instance of QgisApp is created in function main(main.cpp),
but main finishes with myApp.exec().
So when application will be about to close, instance will still be in the memory and won'be deleted.


#1 Updated by Anne Ghisla about 13 years ago

Which are the steps and the setup to reproduce this bug?

#2 Updated by 05092009 - about 13 years ago

Just set a breakpoint in QgisApp's destructor, and close application. Debugger won't go there.
Try to have a look on the code. QgisApp, as you know, is a singleton. It's instance is created in funcion main (main.cpp), but instance should be deleted in a straightforward way, by calling delete. Instead of these, no delete called and main just returns QApplication's exec.
That causes all the data, associated with QgisApp to stay in memory 4ever.

#3 Updated by Martin Dobias about 13 years ago

  • Resolution set to fixed
  • Status changed from Open to Closed

Fixed in 99a32059 (SVN r15752)

Also available in: Atom PDF