We are currently migrating Bugzilla to GitHub issues.
Any changes made to the bug tracker now will be lost, so please do not post new bugs or make changes to them.
When we're done, all bug URLs will redirect to their equivalent location on the new bug tracker.

Bug 4979 - SDL_DROPFILE Memory Leak
Summary: SDL_DROPFILE Memory Leak
Status: ASSIGNED
Alias: None
Product: SDL
Classification: Unclassified
Component: events (show other bugs)
Version: HG 2.1
Hardware: All All
: P2 minor
Assignee: Sam Lantinga
QA Contact: Sam Lantinga
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-02-13 20:33 UTC by Ash
Modified: 2020-02-15 00:28 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ash 2020-02-13 20:33:58 UTC
SDL_DROPFILE events are enabled by default. When a user drags and drops one or more files onto a window, dynamic memory is allocated for each file path. This is done via SDL_SendDrop on line 64 of SDL_dropevents.c (SDL version 2.0.10).

This means that every SDL2 application has a possible memory leak if the application never checks for SDL_DROPFILE events in its event loop.

The Wiki says that this existed since version 2.0.0. Because SDL_DROPTEXT uses the same code path since version 2.0.5, it would also be affected.
Comment 1 Sam Lantinga 2020-02-15 00:28:51 UTC
That's correct. We will address this in the next major version of SDL where we break ABI compatibility.