Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error when closing SDL_Video system #17

Open
caiiiycuk opened this issue Aug 6, 2013 · 5 comments
Open

Error when closing SDL_Video system #17

caiiiycuk opened this issue Aug 6, 2013 · 5 comments

Comments

@caiiiycuk
Copy link

Every time when i exit the game, i have error:

I/libSDL  ( 6328): Calling VideoQuit()
E/libSDL  ( 6328): ERROR: Invalid window
E/libSDL  ( 6328): ERROR: Invalid texture
E/libSDL  ( 6328): ERROR: ANDROID_FreeHWSurface: cannot find freed HW surface in HwSurfaceList array

Any ideas?

@caiiiycuk
Copy link
Author

Initialization:

V/libSDL  ( 6402): calling SDL_SetVideoMode(640, 400, 8, 536870912)
I/libSDL  ( 6402): SDL_SetVideoMode(): application requested mode 640x400 OpenGL 0 HW 0 BPP 16
E/libSDL  ( 6402): ERROR: Setting the swap interval is not supported
E/libSDL  ( 6402): ERROR: Getting the swap interval is not supported
E/libSDL  ( 6402): ERROR: GL_GetAttribute not supported
I/libSDL  ( 6402): ANDROID_GL_GetProcAddress("glGetString"): 0x408d299c
V/libSDL  ( 6402): SDL_SetVideoMode(): Requested mode: 640x400x8, obtained mode 640x400x16
V/libSDL  ( 6402): SDL_SetVideoMode(): returning surface 0x4697f0

@pelya
Copy link
Owner

pelya commented Aug 6, 2013

That's a long-standing bug. Most apps don't care what happens after deinitializing SDL - previously SDL just crashed after SDL_Quit(), now it prints few error messages. It matters only if you'll be calling SDL_Init()/SDL_Quit() from your code multiple times, in this case SDL will crash or misbehave - I was lucky to not encounter such code, so I consider this bug minor.
What's your usage scenario? Does it impacts your code?

@caiiiycuk
Copy link
Author

Native app call SDL_Quit() once and then exit with code 0. But android app died and not closed correctly.

I/libSDL  ( 9656): Calling VideoQuit()
E/libSDL  ( 9656): ERROR: Invalid window
E/libSDL  ( 9656): ERROR: Invalid texture
E/libSDL  ( 9656): ERROR: ANDROID_FreeHWSurface: cannot find freed HW surface in HwSurfaceList array
W/OpenDUNE( 9656): Done
I/WindowManager(  204): WIN DEATH: Window{40f18348 SurfaceView paused=false}
I/ActivityManager(  204): Process com.gamesinjs.dune2 (pid 9656) has died.
W/ActivityManager(  204): Force removing ActivityRecord{40ec7538 com.gamesinjs.dune2/.MainActivity}: app died, no saved state
I/WindowManager(  204): WIN DEATH: Window{40ea6300 com.gamesinjs.dune2/com.gamesinjs.dune2.MainActivity paused=false}

And i can't close resources via onDestroy(). There is any workaround, i can change native app if needed.

@pelya
Copy link
Owner

pelya commented Aug 7, 2013

exit() call (or System.exit() from Java code) will kill whole process, and onDestroy will not be called.
If you need to invoke some de-initialization code, you'll have to place it either at the end of your main()/SDL_main() in C code, or before System.exit(0) call inside project/java/Video.java:439 for Java code.

@caiiiycuk
Copy link
Author

Thanks! I will try this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants