Opened 9 years ago

Closed 8 years ago

#3225 closed defect (fixed)

[PATCH] Fix memory leak in replay mode

Reported by: kanetaka Owned by: ben
Priority: Should Have Milestone: Alpha 20
Component: Core engine Keywords: wmain leak replay
Cc: kanetaka Patch:

Description

Temporary buffer allocation in wmain() causes memory leak in replay mode, because free() is skipped in case of replay mode. There are many leaks in replay mode, because exit path is different from normal game play, which cause to skip to free/delete pointers.

Attachments (1)

wseh.cpp.patch (1.1 KB ) - added by kanetaka 9 years ago.

Download all attachments as: .zip

Change History (5)

by kanetaka, 9 years ago

Attachment: wseh.cpp.patch added

comment:1 by leper, 9 years ago

This sort of duplicates #3138, which removes wmain. That still needs SDL 2.0.4 to be released (or us building a hg version of it).

Replay mode, as every other special-cased mode has issues like this and likely a few others (mod mounting logic in a few places instead of one, init of stuff, ...) but this should best be fixed by using the init/shutdown code paths up to the point we need.

comment:2 by elexis, 9 years ago

free() is skipped in case of replay mode

Which calls do you mean?

comment:3 by Itms, 9 years ago

Milestone: Alpha 19Alpha 20

Pushing this to A20, as we're not going to update SDL (nor introduce breaking changes to wmain) now.

comment:4 by ben, 8 years ago

Owner: set to ben
Resolution: fixed
Status: newclosed

In 17658:

Updates precompiled win32 SDL libs to 2.0.4 from libsdl.org.
Fixes windows build with SDL 2.0.4, fixes #3138, #3225

Note: See TracTickets for help on using tickets.