Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Dlang
gtkd
Commits
68b05538
Commit
68b05538
authored
Jun 07, 2019
by
Mike Wey
Browse files
Fix a crash in gtkd_container_remove.
parent
a9db0911
Changes
4
Hide whitespace changes
Inline
Side-by-side
generated/gtkd/gtk/Container.d
View file @
68b05538
...
...
@@ -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
)();
}
}
}
...
...
generated/gtkd/rsvg/c/types.d
View file @
68b05538
...
...
@@ -126,11 +126,11 @@ struct RsvgPositionData
enum
MAJOR_VERSION
=
2
;
alias
LIBRSVG_MAJOR_VERSION
=
MAJOR_VERSION
;
enum
MICRO_VERSION
=
1
3
;
enum
MICRO_VERSION
=
1
4
;
alias
LIBRSVG_MICRO_VERSION
=
MICRO_VERSION
;
enum
MINOR_VERSION
=
44
;
alias
LIBRSVG_MINOR_VERSION
=
MINOR_VERSION
;
enum
VERSION
=
"2.44.1
3
"
;
enum
VERSION
=
"2.44.1
4
"
;
alias
LIBRSVG_VERSION
=
VERSION
;
generated/vte/vte/c/types.d
View file @
68b05538
...
...
@@ -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
;
/**
...
...
src/APILookupGtk.txt
View file @
68b05538
...
...
@@ -1050,7 +1050,7 @@ code: start
Signals.connect(this, "remove", cast(GCallback)>kd_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)();
}
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment