Wireshark mailing list archives

Re: Freeing a GTree in a struct creted with wmem_new0


From: Pascal Quantin <pascal.quantin () gmail com>
Date: Sat, 22 Apr 2017 13:54:40 +0200

Hi,

Le 22 avr. 2017 13:49, "ss ws" <sswsdev () gmail com> a écrit :

Hey there
I want to add a GTree field to the 'umts_fp_conversation_info_t' struct and
want to make sure I'm not creating a memory leak.

This struct is currently created using *wmem_new0* with the *wmem_file_scope
*allocator.
I understand that creating and freeing GTrees should be done
using g_tree_new_full and g_tree_destroy respectivly

Since the struct is freed automatically when the file is closed, I don't
really know where to place the g_tree_destory call. What should I do?


Why not use a wmem_tree? Is there any feature from GTree you need that is
not provided by wmem?

Best regards,
Pascal.
___________________________________________________________________________
Sent via:    Wireshark-dev mailing list <wireshark-dev () wireshark org>
Archives:    https://www.wireshark.org/lists/wireshark-dev
Unsubscribe: https://www.wireshark.org/mailman/options/wireshark-dev
             mailto:wireshark-dev-request () wireshark org?subject=unsubscribe

Current thread: