]> rtime.felk.cvut.cz Git - orte.git/commitdiff
Merge branch 'shape_fixes' of https://github.com/Vajnar/orte
authorMichal Sojka <sojkam1@fel.cvut.cz>
Wed, 27 May 2015 08:41:46 +0000 (10:41 +0200)
committerMichal Sojka <sojkam1@fel.cvut.cz>
Wed, 27 May 2015 08:41:46 +0000 (10:41 +0200)
orte/contrib/shape_android/src/org/ocera/orte/shape_android/BoxType.java
orte/contrib/shape_android/src/org/ocera/orte/shape_android/PublisherActivity.java
orte/contrib/shape_android/src/org/ocera/orte/shape_android/PublisherShape.java
orte/contrib/shape_android/src/org/ocera/orte/shape_android/SubscriberElement.java

index d9e8d08f96f62a838e97c34edaf5caf91868ef99..a51f3e7f189d48408c09ee89343cde39e7d3c997 100644 (file)
@@ -59,7 +59,6 @@ public class BoxType extends MessageData
                }
                
                this.allowScaling = true;
-               this.buffer.order(null); // set buffer to Little endian (Shape uses this)
        }
 
        /* (non-Javadoc)
index 11e8bab8335a6e12e232457b91b002a31bb08aeb..557482de86fc4dcffbc4b5b7430902d090eee2d8 100644 (file)
@@ -171,7 +171,15 @@ public class PublisherActivity extends Activity {
        public void onDestroy()
        {
                super.onDestroy();
-               
+
+               handler.removeCallbacks(redraw);
+
+               for (PublisherShape shape : publisherView.shapes)
+                       shape.killMe();
+
+               for (SubscriberElement element : subscriberView.elements)
+                       element.killMe();
+
                if (appDomain != null) {
                        appDomain.destroy();
                        appDomain = null;
index daf55adb4b988d6e8def4c49403eb16d8d08d06e..212be3f016208255eb5f19ce51e4d76cecb9e81e 100644 (file)
@@ -312,7 +312,10 @@ public class PublisherShape extends ShapeDrawable
         */
        public void killMe()
        {
-               this.publication.destroy();
+               if (this.publication != null) {
+                       this.publication.destroy();
+                       this.publication = null;
+               }
        }
        
        /**
index a16326ae5bd90a793588c7868a4d3eeec7429a14..6b74f63fc900cd2f72437e95f0ff5dca108fdd40 100644 (file)
@@ -243,4 +243,15 @@ public class SubscriberElement extends SubscriptionCallback
                this.setShape();
        }
 
+        /**
+         * When subscriber is removed, destroy subscription.
+         * 
+         * @since 1.0
+         */
+       public void killMe() {
+               if (this.subscription != null) {
+                       this.subscription.destroy();
+                       this.subscription = null;
+               }
+       }
 }