# \[Patch\] Don't get unnecessary gobject properties when markin

**URL:** <https://www.ruby-forum.com/t/patch-dont-get-unnecessary-gobject-properties-when-markin/95652>\
**Category:** Ruby-Gnome 2\
**Created:** [June 8, 2006, 3:15am UTC](https://www.ruby-forum.com/t/patch-dont-get-unnecessary-gobject-properties-when-markin/95652 "2006-06-08T03:15:31Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![unknown](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/u/4bbf92/32.png) [@unknown](https://www.ruby-forum.com/u/unknown)\
**Post date:** [June 8, 2006, 3:15am UTC](https://www.ruby-forum.com/t/patch-dont-get-unnecessary-gobject-properties-when-markin/95652/1 "2006-06-08T03:15:31Z")

</div>

Hi,

The mark fonction for GLib::Object retrieves all properties on an  
object to  
potentially mark them. While it will only actually mark them if it’s  
another  
object.

Which if ofcourse kinda wastefull… Attached patch changes the mark  
function  
to only retrieve the object property if it’s a GObject… Ok to commit  
?

I was wondering why it’s even the case that object which are  
accessible  
through GObject properties are marked? Is it just to try to keep the  
holder  
struct attached as long as we can see an easy way to get the object ?

Sjoerd

---

<div class="post-metadata">

**Author:** ![unknown](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/u/4bbf92/32.png) [@unknown](https://www.ruby-forum.com/u/unknown)\
**Post date:** [June 9, 2006, 9:27pm UTC](https://www.ruby-forum.com/t/patch-dont-get-unnecessary-gobject-properties-when-markin/95652/2 "2006-06-09T21:27:30Z")

</div>

Hi Sjoerd,

On Thu, 8 Jun 2006 01:11:00 +0200  
removed\_email\_address@domain.invalid (Sjoerd S.) wrote:

> Hi,
> 
> The mark fonction for GLib::Object retrieves all properties on an object to  
> potentially mark them. While it will only actually mark them if it’s another  
> object.
> 
> Which if ofcourse kinda wastefull… Attached patch changes the mark function  
> to only retrieve the object property if it’s a GObject… Ok to commit ?

OK, Apply it, please.

> I was wondering why it’s even the case that object which are accessible  
> through GObject properties are marked? Is it just to try to keep the holder  
> struct attached as long as we can see an easy way to get the object ?

This aims to fix GC problems. The children of Gtk::Container and  
the properties of GLib::Object are managed correctly from ruby side.

–  
.:% Masao M.[removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)
