Skip to content

Commit 4ce9544

Browse files
committed
Fix memory leak
1 parent 9d037be commit 4ce9544

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

lib/ShadowEffect.vala

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ public class Gala.ShadowEffect : Clutter.Effect {
102102
return shadow.texture;
103103
}
104104

105-
var texture = new Cogl.Texture2D.from_bitmap (get_shadow_bitmap (context, width, height, shadow_size, border_radius));
105+
var texture = get_shadow_texture (context, width, height, shadow_size, border_radius);
106106
shadow_cache.@set (current_key, new Shadow (texture));
107107

108108
return texture;
@@ -190,7 +190,7 @@ public class Gala.ShadowEffect : Clutter.Effect {
190190
});
191191
}
192192

193-
private Cogl.Bitmap get_shadow_bitmap (Cogl.Context context, int width, int height, int shadow_size, int corner_radius) {
193+
private Cogl.Texture get_shadow_texture (Cogl.Context context, int width, int height, int shadow_size, int corner_radius) {
194194
var data = new uint8[width * height];
195195

196196
// use fast Gaussian blur approximation
@@ -269,6 +269,6 @@ public class Gala.ShadowEffect : Clutter.Effect {
269269
}
270270
}
271271

272-
return new Cogl.Bitmap.for_data (context, width, height, Cogl.PixelFormat.A_8, width, data);
272+
return new Cogl.Texture2D.from_data (context, width, height, Cogl.PixelFormat.A_8, width, data);
273273
}
274274
}

0 commit comments

Comments
 (0)