SDL Wiki
(This is the documentation for SDL3, which is under heavy development and the API is changing! SDL2 is the current stable version!)


Use this function to free an SDL_RWops structure allocated by SDL_AllocRW().


void SDL_FreeRW(SDL_RWops * area);

Function Parameters


the SDL_RWops structure to be freed


Applications do not need to use this function unless they are providing their own SDL_RWops implementation. If you just need a SDL_RWops to read/write a common data source, you should use the built-in implementations in SDL, like SDL_RWFromFile() or SDL_RWFromMem(), etc, and call the close method on those SDL_RWops pointers when you are done with them.

Only use SDL_FreeRW() on pointers returned by SDL_AllocRW(). The pointer is invalid as soon as this function returns. Any extra memory allocated during creation of the SDL_RWops is not freed by SDL_FreeRW(); the programmer must be responsible for managing that memory in their close method.


This function is available since SDL 3.0.0.

Code Examples

/* this would be your SDL_RWops implementation's "close" method. */
void close_my_rwops(SDL_RWops *rw)
    if (rw != NULL) {
        /* close any other resources. */

CategoryAPI, CategoryIO

[ edit | delete | history | feedback | raw ]

[ front page | index | search | recent changes | git repo | offline html ]

All wiki content is licensed under Creative Commons Attribution 4.0 International (CC BY 4.0).
Wiki powered by ghwikipp.