Commit 68b05538 authored by Mike Wey's avatar Mike Wey
Browse files

Fix a crash in gtkd_container_remove.

parent a9db0911
......@@ -273,7 +273,7 @@ public class Container : Widget
Signals.connect(this, "remove", cast(GCallback)&gtkd_container_remove, null);
}
Widget[] children;
private Widget[] children;
static extern(C) void gtkd_container_add(GtkContainer* c, GtkWidget* w)
{
......@@ -287,12 +287,18 @@ public class Container : Widget
static extern(C) void gtkd_container_remove(GtkContainer* c, GtkWidget* w)
{
import gobject.c.functions : g_object_get_data;
import std.array : empty;
if ( auto container = cast(Container)g_object_get_data(cast(GObject*)c, "GObject") )
if ( auto widget = cast(Widget)g_object_get_data(cast(GObject*)w, "GObject") )
{
import std.algorithm : remove;
container.children.remove!(a => a is widget)();
if ( container.children.empty )
return;
if ( auto widget = cast(Widget)g_object_get_data(cast(GObject*)w, "GObject") )
{
import std.algorithm : remove;
container.children.remove!(a => a is widget)();
}
}
}
......
......@@ -126,11 +126,11 @@ struct RsvgPositionData
enum MAJOR_VERSION = 2;
alias LIBRSVG_MAJOR_VERSION = MAJOR_VERSION;
enum MICRO_VERSION = 13;
enum MICRO_VERSION = 14;
alias LIBRSVG_MICRO_VERSION = MICRO_VERSION;
enum MINOR_VERSION = 44;
alias LIBRSVG_MINOR_VERSION = MINOR_VERSION;
enum VERSION = "2.44.13";
enum VERSION = "2.44.14";
alias LIBRSVG_VERSION = VERSION;
......@@ -364,7 +364,7 @@ alias VTE_MAJOR_VERSION = MAJOR_VERSION;
* The micro version number of the VTE library
* (e.g. in version 3.1.4 this is 4).
*/
enum MICRO_VERSION = 2;
enum MICRO_VERSION = 3;
alias VTE_MICRO_VERSION = MICRO_VERSION;
/**
......
......@@ -1050,7 +1050,7 @@ code: start
Signals.connect(this, "remove", cast(GCallback)&gtkd_container_remove, null);
}
Widget[] children;
private Widget[] children;
static extern(C) void gtkd_container_add(GtkContainer* c, GtkWidget* w)
{
......@@ -1064,12 +1064,18 @@ code: start
static extern(C) void gtkd_container_remove(GtkContainer* c, GtkWidget* w)
{
import gobject.c.functions : g_object_get_data;
import std.array : empty;
if ( auto container = cast(Container)g_object_get_data(cast(GObject*)c, "GObject") )
if ( auto widget = cast(Widget)g_object_get_data(cast(GObject*)w, "GObject") )
{
import std.algorithm : remove;
container.children.remove!(a => a is widget)();
if ( container.children.empty )
return;
if ( auto widget = cast(Widget)g_object_get_data(cast(GObject*)w, "GObject") )
{
import std.algorithm : remove;
container.children.remove!(a => a is widget)();
}
}
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment