diff --git a/lime/Assets.hx b/lime/Assets.hx index 0182aa001..71a9dae1c 100644 --- a/lime/Assets.hx +++ b/lime/Assets.hx @@ -935,6 +935,7 @@ class Assets { if (library != null) { cache.clear (name + ":"); + library.unload (); library.eventCallback = null; } @@ -1140,6 +1141,13 @@ class AssetLibrary { } + private function unload ():Void { + + + + } + + } diff --git a/lime/_backend/native/NativeApplication.hx b/lime/_backend/native/NativeApplication.hx index fc8645d0e..bfb02bf86 100644 --- a/lime/_backend/native/NativeApplication.hx +++ b/lime/_backend/native/NativeApplication.hx @@ -144,9 +144,11 @@ class NativeApplication { case CONNECT: - var gamepad = new Gamepad (gamepadEventInfo.id); - Gamepad.devices.set (gamepadEventInfo.id, gamepad); - parent.window.onGamepadConnect.dispatch (gamepad); + if (!Gamepad.devices.exists(gamepadEventInfo.id)) { + var gamepad = new Gamepad (gamepadEventInfo.id); + Gamepad.devices.set (gamepadEventInfo.id, gamepad); + parent.window.onGamepadConnect.dispatch (gamepad); + } case DISCONNECT: @@ -753,4 +755,4 @@ private class WindowEventInfo { var WINDOW_RESIZE = 9; var WINDOW_RESTORE = 10; -} \ No newline at end of file +}