Multi-window fix

This commit is contained in:
Joshua Granick
2016-09-12 11:48:17 -07:00
parent 1d1e37fc46
commit b883c9f530
3 changed files with 15 additions and 3 deletions

View File

@@ -252,6 +252,12 @@ class Application extends Module {
windowByID.remove (window.id); windowByID.remove (window.id);
window.close (); window.close ();
if (window.renderer != null) {
removeRenderer (window.renderer);
}
if (this.window == window) { if (this.window == window) {
this.window = null; this.window = null;

View File

@@ -127,7 +127,11 @@ class Module implements IModule {
@:noCompletion public function removeWindow (window:Window):Void { @:noCompletion public function removeWindow (window:Window):Void {
if (window != null && __windows.indexOf (window) > -1) {
__windows.remove (window);
}
} }

View File

@@ -218,7 +218,9 @@ namespace lime {
SDL_RenderReadPixels (sdlRenderer, &bounds, SDL_PIXELFORMAT_ABGR8888, buffer->data->Data (), buffer->Stride ()); SDL_RenderReadPixels (sdlRenderer, &bounds, SDL_PIXELFORMAT_ABGR8888, buffer->data->Data (), buffer->Stride ());
for (unsigned char *it=buffer->data->Data () + 3; it < (buffer->data->Data () + buffer->data->Length ()); it += 4) { for (unsigned char *it=buffer->data->Data () + 3; it < (buffer->data->Data () + buffer->data->Length ()); it += 4) {
*it = 0xff; *it = 0xff;
} }
} }