Wireshark mailing list archives

Re: Freeing a GTree in a struct creted with wmem_new0


From: ss ws <sswsdev () gmail com>
Date: Sat, 22 Apr 2017 14:59:50 +0300

Actually I was not aware of wmem_tree.
looking at the .h file seems like this would fit my needs.

Thank you!

On Sat, Apr 22, 2017 at 2:54 PM, Pascal Quantin <pascal.quantin () gmail com>
wrote:

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

___________________________________________________________________________
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: