Re: [gob-list] patch adding first-class support of constructor/dispose/finalize methods

From: Jean-Yves Lefort <jylefort_at_brutele.be>
Date: Tue, 29 Jan 2008 01:36:03 +0100

On Mon, 21 Jan 2008 01:24:53 +0100
Jean-Yves Lefort <jylefort_at_brutele.be> wrote:

> The attached patch allows to write:
>
> constructor (self)
> {
> /* hi */
> }
>
> dispose (self)
> {
> /* hi */
> }
>
> finalize (self)
> {
> /* hi */
> }
>
> instead of:
>
> override (G:Object) GObject *
> constructor (GType type, unsigned int n_construct_properties, GObjectConstructParam *construct_params)
> {
> GObject *object;
> Self *self;
>
> object = PARENT_HANDLER(type, n_construct_properties, construct_params);
> self = SELF(object);
>
> /* hi */
>
> return object;
> }
>
> override (G:Object) void
> dispose (GObject *object)
> {
> Self *self = SELF(object);
>
> /* hi */
>
> PARENT_HANDLER(object);
> }
>
> override (G:Object) void
> finalize (GObject *object)
> {
> Self *self = SELF(object);
>
> /* hi */
>
> PARENT_HANDLER(object);
> }

In some cases, the generated class_init function used a nonexistent
g_object_class variable. I've attached a fixed patch.

-- 
Jean-Yves Lefort <jylefort_at_brutele.be>

Received on Mon Jan 28 2008 - 19:07:51 CST

This archive was generated by hypermail 2.2.0 : Sun Apr 17 2011 - 21:05:02 CDT