Issue238

Title lvledit: memory leaks
Priority minor Status open
Assigned To Keywords editor
Linked issues Watchers

Submitted on 2011-07-24 19h07 by tracker_migration, last changed by salimiles.

Messages
Author: tracker_migration Date: 2011-05-05   17h17
Submitted by matthiaskrgr
what I did: start editor in sdl mode

select obstacles
delete obstacles
undo

same for floor
same for WPs

run map validator
resize level
change edges
add/rm level
save mapfile
new map label
new obstacle label
del map label
del obstacle label
exit editor


The interesting stuff:


==13225== 17 bytes in 1 blocks are definitely lost in loss record 51 of 747
==13225==    at 0x4C28FAC: malloc (vg_replace_malloc.c:236)
==13225==    by 0x470017: CreateNewMapLevel (lvledit_actions.c:801)
==13225==    by 0x474F1F: DoLevelEditorMainMenu (lvledit_menu.c:474)
==13225==    by 0x4729D5: leveleditor_process_input (lvledit_input.c:282)
==13225==    by 0x46E6CC: LevelEditor (lvledit.c:281)
==13225==    by 0x453DA4: main (main.c:206)

==13225== 23 bytes in 1 blocks are definitely lost in loss record 54 of 747
==13225==    at 0x4C28FAC: malloc (vg_replace_malloc.c:236)
==13225==    by 0x46FFF5: CreateNewMapLevel (lvledit_actions.c:800)
==13225==    by 0x474F1F: DoLevelEditorMainMenu (lvledit_menu.c:474)
==13225==    by 0x4729D5: leveleditor_process_input (lvledit_input.c:282)
==13225==    by 0x46E6CC: LevelEditor (lvledit.c:281)
==13225==    by 0x453DA4: main (main.c:206)

==13225== 144 bytes in 6 blocks are definitely lost in loss record 377 of 747
==13225==    at 0x4C279FC: calloc (vg_replace_malloc.c:467)
==13225==    by 0x44A5DC: MyMalloc (text_public.c:58)
==13225==    by 0x47A876: level_editor_copy_selection (lvledit_tool_select.c:762)
==13225==    by 0x47A934: level_editor_cut_selection (lvledit_tool_select.c:797)
==13225==    by 0x452FA5: input_key.clone.0 (keyboard.c:703)
==13225==    by 0x45319A: input_key_press (keyboard.c:759)
==13225==    by 0x45102F: input_handle (input.c:125)
==13225==    by 0x472354: leveleditor_process_input (lvledit_input.c:275)
==13225==    by 0x46E6CC: LevelEditor (lvledit.c:281)
==13225==    by 0x453DA4: main (main.c:206)



==13225== 160 bytes in 1 blocks are definitely lost in loss record 393 of 747
==13225==    at 0x4C279FC: calloc (vg_replace_malloc.c:467)
==13225==    by 0x42761A: dynarray_init (dynarray.c:37)
==13225==    by 0x470179: CreateNewMapLevel (lvledit_actions.c:842)
==13225==    by 0x474F1F: DoLevelEditorMainMenu (lvledit_menu.c:474)
==13225==    by 0x4729D5: leveleditor_process_input (lvledit_input.c:282)
==13225==    by 0x46E6CC: LevelEditor (lvledit.c:281)
==13225==    by 0x453DA4: main (main.c:206)


==13225== 204 bytes in 1 blocks are definitely lost in loss record 404 of 747
==13225==    at 0x4C279FC: calloc (vg_replace_malloc.c:467)
==13225==    by 0x44A5DC: MyMalloc (text_public.c:58)
==13225==    by 0x44A002: GetEditableStringInPopupWindow (text.c:662)
==13225==    by 0x46F968: level_editor_action_change_map_label_user (lvledit_actions.c:575)
==13225==    by 0x47BD44: activate_button.clone.1 (lvledit_widget_button.c:77)
==13225==    by 0x47BED6: leveleditor_button_mouserelease (lvledit_widget_button.c:177)
==13225==    by 0x45104F: input_handle (input.c:108)
==13225==    by 0x472354: leveleditor_process_input (lvledit_input.c:275)
==13225==    by 0x46E6CC: LevelEditor (lvledit.c:281)
==13225==    by 0x453DA4: main (main.c:206)
==13225== 
==13225== 204 bytes in 1 blocks are definitely lost in loss record 405 of 747
==13225==    at 0x4C279FC: calloc (vg_replace_malloc.c:467)
==13225==    by 0x44A5DC: MyMalloc (text_public.c:58)
==13225==    by 0x44A002: GetEditableStringInPopupWindow (text.c:662)
==13225==    by 0x46F968: level_editor_action_change_map_label_user (lvledit_actions.c:575)
==13225==    by 0x4527E4: input_key.clone.0 (keyboard.c:639)
==13225==    by 0x45319A: input_key_press (keyboard.c:759)
==13225==    by 0x45102F: input_handle (input.c:125)
==13225==    by 0x472354: leveleditor_process_input (lvledit_input.c:275)
==13225==    by 0x46E6CC: LevelEditor (lvledit.c:281)
==13225==    by 0x453DA4: main (main.c:206)
==13225== 
==13225== 220 bytes in 11 blocks are definitely lost in loss record 413 of 747
==13225==    at 0x4C279FC: calloc (vg_replace_malloc.c:467)
==13225==    by 0x44A5DC: MyMalloc (text_public.c:58)
==13225==    by 0x47A7C9: level_editor_copy_selection (lvledit_tool_select.c:755)
==13225==    by 0x452FC2: input_key.clone.0 (keyboard.c:706)
==13225==    by 0x45319A: input_key_press (keyboard.c:759)
==13225==    by 0x45102F: input_handle (input.c:125)
==13225==    by 0x472354: leveleditor_process_input (lvledit_input.c:275)
==13225==    by 0x46E6CC: LevelEditor (lvledit.c:281)
==13225==    by 0x453DA4: main (main.c:206)
==13225== 
==13225== 220 bytes in 11 blocks are definitely lost in loss record 414 of 747
==13225==    at 0x4C279FC: calloc (vg_replace_malloc.c:467)
==13225==    by 0x44A5DC: MyMalloc (text_public.c:58)
==13225==    by 0x47A7C9: level_editor_copy_selection (lvledit_tool_select.c:755)
==13225==    by 0x47A934: level_editor_cut_selection (lvledit_tool_select.c:797)
==13225==    by 0x452FA5: input_key.clone.0 (keyboard.c:703)
==13225==    by 0x45319A: input_key_press (keyboard.c:759)
==13225==    by 0x45102F: input_handle (input.c:125)
==13225==    by 0x472354: leveleditor_process_input (lvledit_input.c:275)
==13225==    by 0x46E6CC: LevelEditor (lvledit.c:281)
==13225==    by 0x453DA4: main (main.c:206)
==13225== 
==13225== 240 bytes in 1 blocks are definitely lost in loss record 418 of 747
==13225==    at 0x4C279FC: calloc (vg_replace_malloc.c:467)
==13225==    by 0x42761A: dynarray_init (dynarray.c:37)
==13225==    by 0x470163: CreateNewMapLevel (lvledit_actions.c:839)
==13225==    by 0x474F1F: DoLevelEditorMainMenu (lvledit_menu.c:474)
==13225==    by 0x4729D5: leveleditor_process_input (lvledit_input.c:282)
==13225==    by 0x46E6CC: LevelEditor (lvledit.c:281)
==13225==    by 0x453DA4: main (main.c:206)


==13225== 320 bytes in 1 blocks are definitely lost in loss record 442 of 747
==13225==    at 0x4C279FC: calloc (vg_replace_malloc.c:467)
==13225==    by 0x42761A: dynarray_init (dynarray.c:37)
==13225==    by 0x47018F: CreateNewMapLevel (lvledit_actions.c:845)
==13225==    by 0x474F1F: DoLevelEditorMainMenu (lvledit_menu.c:474)
==13225==    by 0x4729D5: leveleditor_process_input (lvledit_input.c:282)
==13225==    by 0x46E6CC: LevelEditor (lvledit.c:281)
==13225==    by 0x453DA4: main (main.c:206)


revision 4563
Author: ahuillet Date: 2011-07-27   06h38
Minor, owing to the size of the leaks.
Author: salimiles Date: 2011-11-15   21h02
Looks like this is issues with the following three functions:
- CreateNewMapLevel() (in lvledit_actions.c )
- level_editor_copy_selection() (in lvledit_tool_select.c )
- GetEditableStringInPopupWindow() (in text.c )


GetEditableStringInPopupWindow() looks fixed in r5153 . The other two I'm a
little bit more uncertain about.
History
Date User Action Args
2011-11-15 21:15:58salimilessettitle: memory leaks -> lvledit: memory leaks
2011-11-15 21:02:15salimilessetmessages: + msg1988
2011-07-27 06:38:21ahuilletsetpriority: bug -> minor
messages: + msg1313
keyword: + editor
title: EDITOR: memory leaks -> memory leaks
2011-07-24 19:07:43tracker_migrationcreate