Skip to content

armgit / krita

Public Imported from GitHub
0

Krita is a free and open source cross-platform application that offers an end-to-end solution for creating digital art files from scratch built on the KDE and Qt frameworks.

C++

Fix ownership issues with auto enabler, add assert for canvas.

Wolthera van Hövell tot Westerflier070dad83d0d6
diff --git a/plugins/dockers/textproperties/TextPropertiesDock.cpp b/plugins/dockers/textproperties/TextPropertiesDock.cpp
index d7307518d9..ee2fdeb92c 100644
--- a/plugins/dockers/textproperties/TextPropertiesDock.cpp
+++ b/plugins/dockers/textproperties/TextPropertiesDock.cpp
@@ -143,10 +143,7 @@ void TextPropertiesDock::setCanvas(KoCanvasBase *canvas)
m_canvas->disconnectCanvasObserver(this);
}
- if (!canvas) {
- m_canvas = 0;
- return;
- }
+ KIS_ASSERT(canvas);
m_canvas = dynamic_cast<KisCanvas2*>(canvas);
}
@@ -161,7 +158,7 @@ void TextPropertiesDock::connectAutoEnabler(QObject *watched)
{
KIS_SAFE_ASSERT_RECOVER_RETURN(watched);
- TextPropertyAutoEnabler *enabler = new TextPropertyAutoEnabler(watched, this);
+ new TextPropertyAutoEnabler(watched, watched);
}
void TextPropertiesDock::slotCanvasTextPropertiesChanged()