-
Notifications
You must be signed in to change notification settings - Fork 5
/
gnome-hackers.txt
34 lines (26 loc) · 1.23 KB
/
gnome-hackers.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
-*-text-*-
This file is intended to contain information for those interested in
working on the GNOME bits of GnuCash.
Memory Management (care with reference counting):
-------------------------------------------------
I was unsure about when you're supposed to _unref widgets, etc., and
getting this right is critical to avoiding memory leaks on the one
hand and dangling pointers on the other. So I asked on the gtk list,
and here was the result:
On 16 Aug 1999, Rob Browning wrote:
>
> I've been poking around the gtk web site and in the docs for
> information on when you're supposed to call gtk_widget_unref. I want
> to make sure I'm handling this right so I don't introduce memory
> leaks, but so far I haven't found anything describing the rules.
> Actually I'd like to know what the guidelines are for all the *_unref
> functions...
>
Read gtk+/docs/refcounting.txt (or something like that).
Also I think some babble about object finalization at
http://pobox.com/~hp/gnome-app-devel.html (follow link to sample
chapters) might be helpful.
Basically you have to unref a widget you never use, but if you put it
in a container the container "assumes" the initial refcount of 1 and
the widget will be deleted along with the container.
Havoc