gtk: Fix crash in CellRenderer.OnGetSize callback
Handle the case when the native cell_area is not set.
This commit is contained in:
parent
a85ebc481f
commit
23a0aa7af2
1 changed files with 3 additions and 1 deletions
|
@ -54,7 +54,9 @@
|
||||||
try {
|
try {
|
||||||
CellRenderer obj = GLib.Object.GetObject (item, false) as CellRenderer;
|
CellRenderer obj = GLib.Object.GetObject (item, false) as CellRenderer;
|
||||||
Gtk.Widget widg = GLib.Object.GetObject (widget, false) as Gtk.Widget;
|
Gtk.Widget widg = GLib.Object.GetObject (widget, false) as Gtk.Widget;
|
||||||
Gdk.Rectangle cell_area = Gdk.Rectangle.New (cell_area_ptr);
|
Gdk.Rectangle cell_area = Gdk.Rectangle.Zero;
|
||||||
|
if (cell_area_ptr != IntPtr.Zero)
|
||||||
|
cell_area = Gdk.Rectangle.New (cell_area_ptr);
|
||||||
int a, b, c, d;
|
int a, b, c, d;
|
||||||
|
|
||||||
obj.OnGetSize (widg, ref cell_area, out a, out b, out c, out d);
|
obj.OnGetSize (widg, ref cell_area, out a, out b, out c, out d);
|
||||||
|
|
Loading…
Add table
Reference in a new issue