diff options
author | Campbell Barton <ideasman42@gmail.com> | 2013-09-11 05:15:13 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2013-09-11 05:15:13 +0400 |
commit | 43c83e24588dc1251353b1d13ca4cf112f8b3117 (patch) | |
tree | c792fee6b80695669cc855e8a8f7e290d4965d5b /intern/ghost/test | |
parent | 44ec0b0aabef4c8d054680281747ea33320f0961 (diff) |
fix double free in ghost c++ gears test program.
Diffstat (limited to 'intern/ghost/test')
-rw-r--r-- | intern/ghost/test/gears/GHOST_Test.cpp | 5 | ||||
-rw-r--r-- | intern/ghost/test/multitest/MultiTest.c | 4 |
2 files changed, 7 insertions, 2 deletions
diff --git a/intern/ghost/test/gears/GHOST_Test.cpp b/intern/ghost/test/gears/GHOST_Test.cpp index 1e641a8643c..6709956e2dd 100644 --- a/intern/ghost/test/gears/GHOST_Test.cpp +++ b/intern/ghost/test/gears/GHOST_Test.cpp @@ -715,13 +715,16 @@ int main(int /*argc*/, char ** /*argv*/) // Add the application as event consumer fSystem->addEventConsumer(&app); - + // Enter main loop while (!app.m_exitRequested) { //printf("main: loop\n"); fSystem->processEvents(true); fSystem->dispatchEvents(); } + + // Remove so ghost doesn't do a double free + fSystem->removeEventConsumer(&app); } // Dispose the system diff --git a/intern/ghost/test/multitest/MultiTest.c b/intern/ghost/test/multitest/MultiTest.c index 2d0afcf671c..e9d5880651e 100644 --- a/intern/ghost/test/multitest/MultiTest.c +++ b/intern/ghost/test/multitest/MultiTest.c @@ -931,11 +931,13 @@ void multitestapp_free(MultiTestApp *app) int main(int argc, char **argv) { + MultiTestApp *app; + #ifndef USE_BMF BLF_init(11, 72); #endif - MultiTestApp *app = multitestapp_new(); + app = multitestapp_new(); multitestapp_run(app); multitestapp_free(app); |