| Summary: | SDL_PushEvent does not copy event | ||
|---|---|---|---|
| Product: | SDL | Reporter: | andre |
| Component: | *don't know* | Assignee: | Ryan C. Gordon <icculus> |
| Status: | RESOLVED INVALID | QA Contact: | Sam Lantinga <slouken> |
| Severity: | normal | ||
| Priority: | P2 | CC: | john |
| Version: | HG 2.0 | ||
| Hardware: | x86_64 | ||
| OS: | Linux | ||
|
Description
andre
2012-03-13 15:35:40 UTC
The event is copied by value. SDL_PushEvent calls SDL_PeepEvent, which calls SDL_AddEvent, which performs the by-value copy. Note that if your event contains userdata pointers, the pointers are copied, not the memory they point to. You need to manage those objects yourself and make sure you don't free them while the event is being delivered. |