This fixes it on OS X, and stil works for me on Linux. Note that
explicitly deleting the window object on Linux causes a crash. By
setting a breakpoint in ~MainWindow, I see that before this change, on
OS X, the dtor is not called. Meanwhile, something in the GUI is likely
still using Qt during/after app.exit() (it was hanging in QtColor, but
the backtrace did not lead back to Kdenlive source). Howevever, on
Linux, without explicitly deleting the window object, the debugger still
stops on the breakpoint inside the dtor! Might this be dependent on Qt
version?
svn path=/trunk/kdenlive/; revision=4833
KCmdLineArgs::addCmdLineOptions(options); //new
KApplication app;
+ MainWindow* window = 0;
// see if we are starting with session management
if (app.isSessionRestored()) {
while (KMainWindow::canBeRestored(n)) {
const QString className = KXmlGuiWindow::classNameOfToplevel(n);
if (className == QLatin1String("MainWindow")) {
- MainWindow* win = new MainWindow();
- win->restore(n);
+ window = new MainWindow();
+ window->restore(n);
} else {
kWarning() << "Unknown class " << className << " in session saved data!";
}
if (args->count()) {
url = args->url(0);
}
- MainWindow* window = new MainWindow(mltPath, url);
+ window = new MainWindow(mltPath, url);
window->show();
args->clear();
}
- return app.exec();
+ int result = app.exec();
+#ifdef Q_WS_MAC
+ delete window;
+#endif
+ return result;
}
if (m_projectMonitor) m_projectMonitor->stop();
if (m_clipMonitor) m_clipMonitor->stop();
- if (m_activeTimeline) delete m_activeTimeline;
-
+ delete m_activeTimeline;
delete m_effectStack;
delete m_transitionConfig;
-
- if (m_activeDocument) delete m_activeDocument;
-#ifndef Q_WS_MAC
- // This sometimes causes crash on exit on OS X for some reason.
+ delete m_activeDocument;
delete m_projectMonitor;
delete m_clipMonitor;
-#endif
delete m_shortcutRemoveFocus;
Mlt::Factory::close();
}