cocos2d/cocos2d-x — pull request #2476 by TimothyZhang (2013-04-27 08:11:11+00:00)
Title: Adds weak reference support

adds a new class "CCWeakReference", and some test codes in HelloCpp.

Usage:
-------------------------
```
CCObject *obj = new CCObject()
CCWeakReference ref1 = CCWeakRefenrece(obj);
CCWeakReference ref2;
ref2 = ref1;
ref2.getObject(); // obj
CC_SAFE_RELEASE_NULL(obj);
ref2.getObject(); // NULL
```

Efficiency:
-------------------------
The only overhead is
```
releaseWeakReferenceFor(this);
```
called in CCObject::~CCObject(). But the time it takes is really negligible. It runs at O(lgN) time, in which N is the amount of CCObjects been weak referenced.