diff options
author | Ixtli <cg@325i.org> | 2010-04-27 00:53:36 +0900 |
---|---|---|
committer | Enne Walker <enne.walker@gmail.com> | 2010-05-01 10:04:53 -0400 |
commit | a5163abad931b272103febbae202fd602818732c (patch) | |
tree | 1849ca3edada32139adf0a911362a5e1545f34ae /crawl-ref/source/windowmanager-sdl.cc | |
parent | 1ebe1d600db89dbeaf74b03317a8676a4c6c9338 (diff) | |
download | crawl-ref-a5163abad931b272103febbae202fd602818732c.tar.gz crawl-ref-a5163abad931b272103febbae202fd602818732c.zip |
Created a static WindowManager::shutdown() fxn
tilesdl.cc now calls this after GLStateManager::shutdown() so
that it is not responsible for managing the wm pointer.
Signed-off-by: Enne Walker <enne.walker@gmail.com>
Diffstat (limited to 'crawl-ref/source/windowmanager-sdl.cc')
-rw-r--r-- | crawl-ref/source/windowmanager-sdl.cc | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/crawl-ref/source/windowmanager-sdl.cc b/crawl-ref/source/windowmanager-sdl.cc index 4d2caa3db8..54d45d65fe 100644 --- a/crawl-ref/source/windowmanager-sdl.cc +++ b/crawl-ref/source/windowmanager-sdl.cc @@ -24,6 +24,12 @@ void WindowManager::create() wm = new SDLWrapper(); } +void WindowManager::shutdown() +{ + delete wm; + wm = NULL; +} + static unsigned char _get_modifiers(SDL_keysym &keysym) { // keysym.mod can't be used to keep track of the modifier state. @@ -223,6 +229,11 @@ SDLWrapper::SDLWrapper(): { } +SDLWrapper::~SDLWrapper() +{ + SDL_Quit(); +} + int SDLWrapper::init(coord_def *m_windowsz) { // Do SDL initialization @@ -699,13 +710,6 @@ bool SDLWrapper::load_texture(GenericTexture *tex, const char *filename, return (success); } -void SDLWrapper::shutdown() -{ - SDL_Quit(); - m_context = NULL; - video_info = NULL; -} - int SDLWrapper::byte_order() { if (SDL_BYTEORDER == SDL_BIG_ENDIAN) |