sample: Fix leak in Scribble sample when resizing the window
This commit is contained in:
parent
bc309f3093
commit
cf7aa5222e
1 changed files with 4 additions and 0 deletions
|
@ -90,6 +90,10 @@ namespace GtkSamples {
|
||||||
|
|
||||||
protected override bool OnConfigureEvent (EventConfigure ev)
|
protected override bool OnConfigureEvent (EventConfigure ev)
|
||||||
{
|
{
|
||||||
|
if (surface != null) {
|
||||||
|
surface.Dispose ();
|
||||||
|
}
|
||||||
|
|
||||||
surface = ev.Window.CreateSimilarSurface (Cairo.Content.Color, AllocatedWidth, AllocatedHeight);
|
surface = ev.Window.CreateSimilarSurface (Cairo.Content.Color, AllocatedWidth, AllocatedHeight);
|
||||||
ClearSurface ();
|
ClearSurface ();
|
||||||
return true;
|
return true;
|
||||||
|
|
Loading…
Reference in a new issue