Should a GtkFileFilter be freed or not?

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Should a GtkFileFilter be freed or not?

Lars Paulsen
Hello All,

I got a simple question about the GtkFileFilter:

Do I need to free it myself after the dialog I used it in has finished?
Or is gtk_widget_destroy(dialog) doing that for me?

Best Regards,
Lars

_______________________________________________
gtk-app-devel-list mailing list
[hidden email]
https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Should a GtkFileFilter be freed or not?

A. Walton
On Mon, Jul 31, 2017 at 11:56 AM, Lars Paulsen <[hidden email]> wrote:
> Hello All,
>
> I got a simple question about the GtkFileFilter:
>
> Do I need to free it myself after the dialog I used it in has finished?
> Or is gtk_widget_destroy(dialog) doing that for me?

The latter-ish. GtkFileFilter is a GInitiallyUnowned, which means when
you attach it to the file chooser widget, it will assume ownership of
the file filter and unref it for you at the end of its life.

Refer to the Floating References section of the documentation here:
https://developer.gnome.org/gobject/stable/gobject-The-Base-Object-Type.html

-Andrew Walton

> Best Regards,
> Lars
>
> _______________________________________________
> gtk-app-devel-list mailing list
> [hidden email]
> https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
_______________________________________________
gtk-app-devel-list mailing list
[hidden email]
https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Should a GtkFileFilter be freed or not?

Lars Paulsen
Hi Andrew,

great. Thanks for the quick reply.

Greetings,
Lars

Am 31.07.2017 um 13:19 schrieb A. Walton:

> On Mon, Jul 31, 2017 at 11:56 AM, Lars Paulsen <[hidden email]> wrote:
>> Hello All,
>>
>> I got a simple question about the GtkFileFilter:
>>
>> Do I need to free it myself after the dialog I used it in has finished?
>> Or is gtk_widget_destroy(dialog) doing that for me?
>
> The latter-ish. GtkFileFilter is a GInitiallyUnowned, which means when
> you attach it to the file chooser widget, it will assume ownership of
> the file filter and unref it for you at the end of its life.
>
> Refer to the Floating References section of the documentation here:
> https://developer.gnome.org/gobject/stable/gobject-The-Base-Object-Type.html
>
> -Andrew Walton
>
>> Best Regards,
>> Lars
>>
>> _______________________________________________
>> gtk-app-devel-list mailing list
>> [hidden email]
>> https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list

_______________________________________________
gtk-app-devel-list mailing list
[hidden email]
https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
Loading...