From 18f2e401d295bc246526efb44ef3e9994cd05e8c Mon Sep 17 00:00:00 2001 From: Nilsen Filc Date: Wed, 15 Jul 2015 04:51:31 +0200 Subject: [PATCH 1/2] Guard against doppleganger gamepad connection Gamepad connect can fire twice in a row the event for the same device (tested on Mac OSX). Prevent that. --- lime/_backend/native/NativeApplication.hx | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) 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 +} From 250d4b488bb3b1ef1313512e2af716d22b2d9805 Mon Sep 17 00:00:00 2001 From: Joshua Granick Date: Tue, 14 Jul 2015 21:33:41 -0700 Subject: [PATCH 2/2] Add explicit assetLibrary.unload when calling Assets.unloadLibrary --- lime/Assets.hx | 8 ++++++++ 1 file changed, 8 insertions(+) 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 { + + + + } + + }