diff -Nru gtk-sharp2-2.12.40/debian/changelog gtk-sharp2-2.12.40/debian/changelog --- gtk-sharp2-2.12.40/debian/changelog 2017-04-03 01:33:48.000000000 +0800 +++ gtk-sharp2-2.12.40/debian/changelog 2017-04-17 14:55:40.000000000 +0800 @@ -1,3 +1,14 @@ +gtk-sharp2 (2.12.40-2) unstable; urgency=medium + + * [bf035d9] fix Gtk.TreeView.get/set_Model() throwing NullReferenceException. + This fix is a cherry-picked commit 4ac71507fffce997207215ac3f8b38471ce60a14 + from upstream's git repository. + The fix is already included in a newer upstream version (GTK# 2.12.41), but + for getting a freeze exception I have only backported the fix that affects + the Debian release. (Closes: #860450) + + -- Mirco Bauer Mon, 17 Apr 2017 14:55:40 +0800 + gtk-sharp2 (2.12.40-1.1) unstable; urgency=medium * Non-maintainer upload. diff -Nru gtk-sharp2-2.12.40/debian/patches/04_fix_treeview_model_ref gtk-sharp2-2.12.40/debian/patches/04_fix_treeview_model_ref --- gtk-sharp2-2.12.40/debian/patches/04_fix_treeview_model_ref 1970-01-01 08:00:00.000000000 +0800 +++ gtk-sharp2-2.12.40/debian/patches/04_fix_treeview_model_ref 2017-04-17 14:55:40.000000000 +0800 @@ -0,0 +1,63 @@ +Index: gtk-sharp2/gtk/Gtk.metadata +=================================================================== +--- gtk-sharp2.orig/gtk/Gtk.metadata 2017-04-17 12:03:38.972461869 +0800 ++++ gtk-sharp2/gtk/Gtk.metadata 2017-04-17 12:03:38.968461869 +0800 +@@ -950,8 +950,5 @@ + true + true + true +- false +- false +- 1 +- 1 ++ 1 + +Index: gtk-sharp2/gtk/TreeView.custom +=================================================================== +--- gtk-sharp2.orig/gtk/TreeView.custom 2017-04-17 12:03:38.972461869 +0800 ++++ gtk-sharp2/gtk/TreeView.custom 2017-04-17 12:03:38.968461869 +0800 +@@ -25,27 +25,27 @@ + + + [DllImport("libgtk-win32-2.0-0.dll", CallingConvention = CallingConvention.Cdecl)] +- static extern IntPtr gtk_tree_view_get_model(IntPtr raw); +- +- [DllImport("libgtk-win32-2.0-0.dll", CallingConvention = CallingConvention.Cdecl)] +- static extern void gtk_tree_view_set_model(IntPtr raw, IntPtr model); ++ static extern IntPtr gtk_tree_view_new_with_model(IntPtr model); + + [DllImport("libgobject-2.0-0.dll", CallingConvention=CallingConvention.Cdecl)] +- static extern void g_object_unref (IntPtr raw); ++ static extern void g_object_ref (IntPtr raw); + +- [GLib.Property ("model")] +- public Gtk.TreeModel Model { +- get { +- IntPtr raw_ret = gtk_tree_view_get_model(Handle); +- Gtk.TreeModel ret = Gtk.TreeModelAdapter.GetObject (raw_ret, false); +- return ret; +- } +- set { +- var storeHandle = value == null ? IntPtr.Zero : value.Handle; +- gtk_tree_view_set_model(Handle, storeHandle); +- if (storeHandle != IntPtr.Zero) +- g_object_unref (storeHandle); ++ public TreeView (Gtk.TreeModel model) : base (IntPtr.Zero) ++ { ++ if (GetType () != typeof (TreeView)) { ++ var vals = new GLib.Value[1]; ++ var names = new IntPtr[1]; ++ var param_count = 0; ++ if (model != null) { ++ names[param_count] = GLib.Marshaller.StringToPtrGStrdup ("model"); ++ vals[param_count++] = new GLib.Value (model); ++ } ++ CreateNativeObject (names, vals, param_count); ++ return; + } ++ Raw = gtk_tree_view_new_with_model(model == null ? IntPtr.Zero : model.Handle); ++ if (model != null) ++ g_object_ref (model.Handle); + } + + [Obsolete ("Use NodeView with NodeStores")] diff -Nru gtk-sharp2-2.12.40/debian/patches/series gtk-sharp2-2.12.40/debian/patches/series --- gtk-sharp2-2.12.40/debian/patches/series 2017-04-03 01:33:48.000000000 +0800 +++ gtk-sharp2-2.12.40/debian/patches/series 2017-04-17 14:55:40.000000000 +0800 @@ -1,4 +1,5 @@ 01_dllmaps 02_pcfiles 03_missing_gtk-sharp_dllmap_entry +04_fix_treeview_model_ref no-void-cachetype.patch