diff options
Diffstat (limited to 'Applications/PixelPaint/ImageEditor.cpp')
-rw-r--r-- | Applications/PixelPaint/ImageEditor.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/Applications/PixelPaint/ImageEditor.cpp b/Applications/PixelPaint/ImageEditor.cpp index 6a503d3bb3..5959eb80fe 100644 --- a/Applications/PixelPaint/ImageEditor.cpp +++ b/Applications/PixelPaint/ImageEditor.cpp @@ -39,10 +39,22 @@ ImageEditor::ImageEditor() { } +ImageEditor::~ImageEditor() +{ + if (m_image) + m_image->remove_client(*this); +} + void ImageEditor::set_image(RefPtr<Image> image) { + if (m_image) + m_image->remove_client(*this); + m_image = move(image); update(); + + if (m_image) + m_image->add_client(*this); } void ImageEditor::paint_event(GUI::PaintEvent& event) |