]> git.tdb.fi Git - libs/core.git/commitdiff
Prevent a crash if application destructor throws
authorMikko Rasa <tdb@tdb.fi>
Mon, 23 May 2011 18:28:25 +0000 (21:28 +0300)
committerMikko Rasa <tdb@tdb.fi>
Tue, 24 May 2011 06:02:35 +0000 (09:02 +0300)
source/core/application.cpp

index a588e9dbb7900cff2b3d15a200f41a9be2382d8f..badc52304ab4df6dc8c563aa9708109e5c387959 100644 (file)
@@ -61,7 +61,9 @@ int Application::run(int argc, char **argv, void *data)
                }
 
                int result=app_->main();
-               delete app_;
+               Application *a=app_;
+               app_=0;
+               delete a;
                return result;
        }
        catch(const exception &e)