MantisBT - VCMI
View Issue Details
0002091VCMIGUI - Otherpublic2015-02-15 15:502016-01-17 12:36
Kantor 
SXX 
normalmajoralways
closedfixed 
0.97b 
0.97c 
0002091: Keeping pressed any hotkey button on keyboard lead to significant memory leak
As summary says, keeping pressed any hotkey button on keyboard lead to significant memory leak both in pregame GUI or in anywhere else.
Simply launch VCMI_client and in the menu keep pressed, eg. 'N' hotkey for New Game option.
No tags attached.
Issue History
2015-02-15 15:50KantorNew Issue
2015-02-15 17:23SXXNote Added: 0005514
2015-02-15 17:23SXXAssigned To => SXX
2015-02-15 17:23SXXStatusnew => confirmed
2015-02-15 17:48SXXNote Added: 0005515
2015-02-15 18:11SXXNote Added: 0005516
2015-02-15 20:03SXXNote Added: 0005517
2015-02-15 22:08SXXNote Added: 0005518
2015-02-15 22:08SXXStatusconfirmed => resolved
2015-02-15 22:08SXXFixed in Version => 0.97c
2015-02-15 22:08SXXResolutionopen => fixed
2016-01-17 12:36SXXStatusresolved => closed

Notes
(0005514)
SXX   
2015-02-15 17:23   
I already investigated this one from my personal interest. According to Massif biggest leak everywhere is inside CButton::leftClick that lead to SoundHandler::GetSoundChunk, but it's not problem with "chunk" as far as I remember. E.g it's something wrong within CSoundHandler::GetSoundChunk or even in SDL2 (though I doubt it).
(0005515)
SXX   
2015-02-15 17:48   
Oh, feel myself a dumb. Previous time when I tried to fix it I'd edited wrong "CSoundHandler::playSound" function. Basically we just need to use "Mix_FreeChunk" in both of them (when chunk playback finished of course).
(0005516)
SXX   
2015-02-15 18:11   
Though once I fixed this massif start crashing for me. :-)
So can only make sure it's fixed by testing.

Though I'll make some more code cleanup here and then likely sent pull request for review.
(0005517)
SXX   
2015-02-15 20:03   
Pull request:
https://github.com/vcmi/vcmi/pull/89 [^]
(0005518)
SXX   
2015-02-15 22:08   
Should be now fixed in git:
https://github.com/vcmi/vcmi/commit/37a5930f84dbab02ac0681597890cde61ff08365 [^]