mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-11 01:06:01 +03:00
PixelPaint: Keep a RefPtr to layer in LayerPropertiesWidget
Using a WeakPtr to keep a reference to the active layer caused it to be destroyed when the last tab was closed, which made the m_layer == layer check in set_layer() return early since it was already null. Because of this the LayerPropertiesWidget was never disabled.
This commit is contained in:
parent
7ca4d045bd
commit
18e6da6d4d
Notes:
sideshowbarker
2024-07-17 21:18:20 +09:00
Author: https://github.com/metmo Commit: https://github.com/SerenityOS/serenity/commit/18e6da6d4d1 Pull-request: https://github.com/SerenityOS/serenity/pull/11743
@ -75,7 +75,7 @@ void LayerPropertiesWidget::set_layer(Layer* layer)
|
||||
return;
|
||||
|
||||
if (layer) {
|
||||
m_layer = layer->make_weak_ptr();
|
||||
m_layer = layer;
|
||||
m_name_textbox->set_text(layer->name());
|
||||
m_opacity_slider->set_value(layer->opacity_percent());
|
||||
m_visibility_checkbox->set_checked(layer->is_visible());
|
||||
|
@ -27,7 +27,7 @@ private:
|
||||
RefPtr<GUI::OpacitySlider> m_opacity_slider;
|
||||
RefPtr<GUI::TextBox> m_name_textbox;
|
||||
|
||||
WeakPtr<Layer> m_layer;
|
||||
RefPtr<Layer> m_layer;
|
||||
};
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user