background: Avoid dangling reference to Background instances

Make sure all references gets dropped on destroy and it gets finalized.
This commit is contained in:
Rico Tzschichholz 2017-02-19 16:50:40 +01:00
parent 9f6b9313db
commit ea7c28515d
2 changed files with 2 additions and 2 deletions

View File

@ -51,7 +51,7 @@ namespace Gala
construct
{
background = new Meta.Background (screen);
background.set_data<Background> ("delegate", this);
background.set_data<unowned Background> ("delegate", this);
file_watches = new Gee.HashMap<string,ulong> ();
cancellable = new Cancellable ();

View File

@ -101,7 +101,7 @@ namespace Gala
new_background_actor.brightness = background_actor.brightness;
new_background_actor.visible = background_actor.visible;
var background = new_background_actor.background.get_data<Background> ("delegate");
var background = new_background_actor.background.get_data<unowned Background> ("delegate");
if (background.is_loaded) {
swap_background_actor ();