[SDL] error when deleting window?

why cant i delete the window* i got from SDL_CreateWindow()
in my class destructor?

i wanna release it from the heap but its not allowing me?
is it because sdl is doing it automatically for me or what?

thanks :)
http://wiki.libsdl.org/SDL_DestroyWindow

You can only delete pointers that have been created by new.
ah thanks,
but why do i get an error when i try to delete it the usual way with the delete keyword?
SDL is written in C so it probably uses malloc/calloc to allocate the memory so if anything you should use free to delete it, but don't do that! C doesn't have destructors. That's why they provide you with a special function for destroying the window so that they can run additional code to clean up everything properly.
Last edited on
thanks
Topic archived. No new replies allowed.