From 56a0288b7b613d282e888f1d5b7c59b8d5af8365 Mon Sep 17 00:00:00 2001 From: Mike Kestner Date: Thu, 30 Dec 2004 18:59:09 +0000 Subject: [PATCH] 2004-12-30 Mike Kestner * glib/Object.cs : mark the Data hashtable obsolete. svn path=/trunk/gtk-sharp/; revision=38201 --- ChangeLog | 4 ++++ doc/en/GLib/Object.xml | 8 +++++++- glib/Object.cs | 1 + 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 0529b0c95..6409455cd 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2004-12-30 Mike Kestner + + * glib/Object.cs : mark the Data hashtable obsolete. + 2004-12-30 Mike Kestner * gtk/Gtk.metadata : hide TreeView.InsertColumnWith*. diff --git a/doc/en/GLib/Object.xml b/doc/en/GLib/Object.xml index ae880be93..26e721f57 100644 --- a/doc/en/GLib/Object.xml +++ b/doc/en/GLib/Object.xml @@ -87,6 +87,12 @@ Stores and Accesses arbitrary data on the Object. a + This property is obsolete and should not be used unless you explicitly retain a reference to the + . Otherwise the Data hashtable will be lost when the Garbage Collector + releases your managed object wrapper. There are much better alternatives to this anyway. Consider + using a Hashtable on your class that is keyed by or a subclass with + an object property for the data you want to store instead. There are many better ways to accompish + the role of this property. @@ -383,4 +389,4 @@ - \ No newline at end of file + diff --git a/glib/Object.cs b/glib/Object.cs index 0352799e7..7f1469e6b 100644 --- a/glib/Object.cs +++ b/glib/Object.cs @@ -285,6 +285,7 @@ namespace GLib { return Handle.GetHashCode (); } + [Obsolete("Can cause instability due to garbage collection of GLib.Objects.")] public Hashtable Data { get { if (data == null)