Commit f4cb66b2 authored by Nicolas Carion's avatar Nicolas Carion

fix some use-after-free when closing

parent 437c5d70
......@@ -378,7 +378,7 @@ int Core::getItemPosition(const ObjectId &id)
int Core::getItemIn(const ObjectId &id)
{
if (!m_guiConstructed) {
qDebug()<<"/ / // QUERYING ITEM IN BUT GUI NOT BUILD!!";
qDebug() << "/ / // QUERYING ITEM IN BUT GUI NOT BUILD!!";
return 0;
}
switch (id.first) {
......@@ -603,7 +603,6 @@ void Core::invalidateRange(QSize range)
m_mainWindow->getCurrentTimeline()->controller()->invalidateZone(range.width(), range.height());
}
void Core::invalidateItem(ObjectId itemId)
{
if (!m_mainWindow || m_mainWindow->getCurrentTimeline()->loading) return;
......@@ -700,3 +699,8 @@ void Core::triggerAction(const QString &name)
action->trigger();
}
}
void Core::clean()
{
m_self.reset();
}
......@@ -78,6 +78,9 @@ public:
/** @brief Returns a pointer to the singleton object. */
static std::unique_ptr<Core> &self();
/** @brief Delete the global core instance */
static void clean();
/** @brief Returns a pointer to the main window. */
MainWindow *window();
......
......@@ -194,6 +194,7 @@ int main(int argc, char *argv[])
Core::build(mltPath);
pCore->initGUI(url);
int result = app.exec();
Core::clean();
if (EXIT_RESTART == result) {
qCDebug(KDENLIVE_LOG) << "restarting app";
......
......@@ -167,7 +167,7 @@ GLWidget::~GLWidget()
m_blackClip.reset();
delete m_shareContext;
delete m_shader;
delete m_monitorProfile;
// delete m_monitorProfile;
}
void GLWidget::updateAudioForAnalysis()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment