Skip to content
This repository


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Retain cycles in TENode #2

merged 1 commit into from about 2 years ago

2 participants

Leroy Campbell Ian Terrell
Leroy Campbell

In TENode.h, child shapes hold a strong reference to their parents (which causes retain cycles). Since the parent object "owns" the child (i.e., contains it), the child shouldn't have a strong reference to its parent.

I've made the parent property a weak reference in order to fix the issue.

Ian Terrell ianterrell merged commit 17f133c into from
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Showing 1 unique commit by 1 author.

Jun 05, 2012
Leroy Campbell artisonian Changed parent property of TENode to a weak reference to fix retain c…
This page is out of date. Refresh to see the latest.

Showing 1 changed file with 2 additions and 2 deletions. Show diff stats Hide diff stats

  1. +2 2 TauEngine/TENode.h
4 TauEngine/TENode.h
@@ -25,7 +25,7 @@
25 25
26 26 NSMutableArray *currentAnimations;
27 27
28   - TENode *parent;
  28 + __weak TENode *parent;
29 29 NSMutableArray *children;
30 30
31 31 BOOL remove;
@@ -46,7 +46,7 @@
46 46 @property(strong, nonatomic) NSString *name;
47 47 @property(strong, nonatomic) TEDrawable *drawable;
48 48 @property(readonly) TEShape *shape;
49   -@property(strong, nonatomic) TENode *parent;
  49 +@property(weak, nonatomic) TENode *parent;
50 50 @property float maxVelocity, maxAcceleration, maxAngularVelocity, maxAngularAcceleration;
51 51 @property BOOL remove;
52 52 @property BOOL collide;

Tip: You can add notes to lines in a file. Hover to the left of a line to make a note

Something went wrong with that request. Please try again.