diff options
author | Marvin W <git@larma.de> | 2020-06-28 11:43:39 +0200 |
---|---|---|
committer | Marvin W <git@larma.de> | 2020-06-28 11:53:43 +0200 |
commit | c16fbdd19f3962f7dc2cfc6f7623448000a49bc5 (patch) | |
tree | 054cb7b976b2f2000731930429cb1ed5c12b87af /main/src/ui/avatar_image.vala | |
parent | af98b8ea0fd256e0860695615b0b2992523591fc (diff) | |
download | dino-c16fbdd19f3962f7dc2cfc6f7623448000a49bc5.tar.gz dino-c16fbdd19f3962f7dc2cfc6f7623448000a49bc5.zip |
Clean up some image rendering code
Diffstat (limited to 'main/src/ui/avatar_image.vala')
-rw-r--r-- | main/src/ui/avatar_image.vala | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/main/src/ui/avatar_image.vala b/main/src/ui/avatar_image.vala index 6142b26e..107e421a 100644 --- a/main/src/ui/avatar_image.vala +++ b/main/src/ui/avatar_image.vala @@ -26,6 +26,13 @@ public class AvatarImage : Misc { get_style_context().add_class("avatar"); } + public override void dispose() { + base.dispose(); + drawer = null; + cached_surface = null; + disconnect_stream_interactor(); + } + public override void get_preferred_width(out int minimum_width, out int natural_width) { minimum_width = width; natural_width = width; @@ -50,6 +57,7 @@ public class AvatarImage : Misc { if (cached_surface != null) { ctx_in.set_source_surface(cached_surface, 0, 0); ctx_in.paint(); + ctx_in.set_source_rgb(0, 0, 0); return true; } width *= scale_factor; @@ -67,15 +75,12 @@ public class AvatarImage : Misc { if (use_image_surface == 1) { ctx_in.set_source_surface(ctx.get_target(), 0, 0); ctx_in.paint(); + ctx_in.set_source_rgb(0, 0, 0); } return true; } - public override void destroy() { - disconnect_stream_interactor(); - } - private void disconnect_stream_interactor() { if (stream_interactor != null) { presence_manager.show_received.disconnect(on_show_received); |