gobject: possible memory leak during finalize() due to freeze_notify()
Hello, I have just started using glib2 and I have encountered an issue now: When user's finalize() does not use GObjectClass' g_object_finalize(), the memory allocated by freeze_notify() will not be released.
Here is my test:
-
test 01
- version: 2.72 (without patch 1ec331266ac5782223d3dafa6c9176eaeefcebae)
- result: normal
-
test 02
- version: 2.72
- result: memory leak
-
test file: alpha.c
-
abnormal result:
~ #
~ # ps -ef | grep alpha
root 2536 2503 34 00:39 pts/1 00:00:04 ./alpha
root 2538 2511 0 00:40 pts/2 00:00:00 grep alpha
~ # pmap -x 2536 > time01.txt
~ # pmap -x 2536 > time02.txt
~ # diff -u time01.txt time02.txt
--- time01.txt
+++ time02.txt
@@ -3,7 +3,7 @@
000055556e8b6000 8 8 8 r-x-- alpha
000055556e8c7000 4 4 4 r---- alpha
000055556e8c8000 4 4 4 rw--- alpha
-000055557f10b000 664 636 636 rw--- [ anon ]
+000055557f10b000 864 772 772 rw--- [ anon ]
00007fff94f94000 32 32 32 r-x-- libffi.so.8.1.0
00007fff94f9c000 60 0 0 ----- libffi.so.8.1.0
00007fff94fab000 4 4 4 r---- libffi.so.8.1.0
@@ -39,4 +39,4 @@
00007fff954e9000 8 8 8 rw--- ld-linux-aarch64.so.1
00007fffc6324000 132 24 24 rw--- [ stack ]
---------------- ------- ------- -------
-total kB 5320 3604 3600
+total kB 5520 3740 3736