Re: gobject bug?



On Wed, 8 Jan 2003, tom wrote:

> i created a fundamental object 'foo':

> GType
> foo_get_type (void)
> {
[...]
> 		type = g_type_register_fundamental (g_type_fundamental_next (), "foo",
> &info, &finfo, 0);
[...]
> }

> but if i do this:
>
> main()
> {
> 	foo *f = foo_new();
> 	foo_destroy(f);
> 	sleep(2);
> 	return 0;
> }
>
> i get:
>
> (process:6270): foo-DEBUG: foo_new
> (process:6270): foo-DEBUG: foo_base_init
> (process:6270): foo-DEBUG: foo_class_init
> (process:6270): foo-DEBUG: foo_instance_init
> (process:6270): foo-DEBUG: foo_destroy
>
> and thats all... why are the functions 'foo_class_finalize' and
> 'foo_base_finalize' not called ?

foo_base_finalize will be called everytime a class of a derived type
or foo gets finalized. foo_class_finalize will be called when the foo
class gets finalized. only classes of dynmic types can be finalized.
dynmic types are registered with an associated plugin though
g_type_register_dynamic(). foo wasn't registred through
g_type_register_dynamic(), so it's class will never be finalized and
foo_class_finalize() won't ever be called.

in brief: fundamental types are always static, so their classes never
          get fnalized.

as a complaint: dynmic fundamental types aren't supported.
response:       right, it's a WONTFIX issue.

>
> thanks
> tom
>

---
ciaoTJ




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]