OSDN Git Service

[fixed] issue 54 (sort off). Checking for null pointers in XXXAudio.dispose() now...
authorbadlogicgames <badlogicgames@6c4fd544-2939-11df-bb46-9574ba5d0bfa>
Tue, 9 Nov 2010 20:36:15 +0000 (20:36 +0000)
committerbadlogicgames <badlogicgames@6c4fd544-2939-11df-bb46-9574ba5d0bfa>
Tue, 9 Nov 2010 20:36:15 +0000 (20:36 +0000)
backends/gdx-backend-jogl/src/com/badlogic/gdx/backends/jogl/JoglAudio.java
backends/gdx-backend-lwjgl/src/com/badlogic/gdx/backends/lwjgl/LwjglAudio.java

index 16219b3..83241ad 100644 (file)
@@ -211,8 +211,12 @@ final class JoglAudio implements Audio, Runnable {
        void dispose() {\r
                run = false;\r
                try {\r
-                       thread.join();\r
-               } catch (InterruptedException e) {\r
+                       if(thread != null)\r
+                               thread.join();\r
+                       if(line != null)\r
+                               line.close();                   \r
+               } \r
+               catch (InterruptedException e) {\r
                }\r
        }\r
 }\r
index a6e7cf0..3105e66 100644 (file)
@@ -198,7 +198,10 @@ final class LwjglAudio implements Audio, Runnable {
        void dispose ( ) {\r
                run = false;\r
                try {\r
-                       thread.join();\r
+                       if(thread != null)\r
+                               thread.join();\r
+                       if(line != null)\r
+                               line.close();\r
                } catch (InterruptedException e) {\r
                }\r
        }\r