mirror of https://github.com/axmolengine/axmol.git
Silenced LLVM SA Warning/Error regarding static singleton pattern. Added dealloc method.
This commit is contained in:
parent
81d8dd0eb2
commit
e3094d80d0
|
@ -67,6 +67,14 @@ static AccelerometerSimulation *sharedAccelerometer = NULL;
|
||||||
|
|
||||||
@implementation AccelerometerSimulation
|
@implementation AccelerometerSimulation
|
||||||
|
|
||||||
|
- (void) dealloc {
|
||||||
|
if (sharedAccelerometer) {
|
||||||
|
[sharedAccelerometer release];
|
||||||
|
sharedAccelerometer = NULL;
|
||||||
|
}
|
||||||
|
[super dealloc];
|
||||||
|
}
|
||||||
|
|
||||||
// this is straight from developer guide example for multi-threaded notifications
|
// this is straight from developer guide example for multi-threaded notifications
|
||||||
- (void) setUpThreadingSupport {
|
- (void) setUpThreadingSupport {
|
||||||
if ( notifications ) return;
|
if ( notifications ) return;
|
||||||
|
@ -126,7 +134,7 @@ static AccelerometerSimulation *sharedAccelerometer = NULL;
|
||||||
};
|
};
|
||||||
[notificationLock unlock];
|
[notificationLock unlock];
|
||||||
}
|
}
|
||||||
|
#ifndef __clang_analyzer__
|
||||||
+ (AccelerometerSimulation *)getAccelerometer
|
+ (AccelerometerSimulation *)getAccelerometer
|
||||||
{
|
{
|
||||||
if( sharedAccelerometer == NULL )
|
if( sharedAccelerometer == NULL )
|
||||||
|
@ -134,7 +142,7 @@ static AccelerometerSimulation *sharedAccelerometer = NULL;
|
||||||
|
|
||||||
return sharedAccelerometer;
|
return sharedAccelerometer;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
- (void)threadLoop:(id)object
|
- (void)threadLoop:(id)object
|
||||||
{
|
{
|
||||||
char buffer[1024];
|
char buffer[1024];
|
||||||
|
|
Loading…
Reference in New Issue