Ejemplo n.º 1
0
void wyDirector::printUnreleasedObjects() {
#ifdef WY_CFLAG_MEMORY_TRACKING
	wyOutputLeakPool();
#else
	LOGW("This method is only available when WY_CFLAG_MEMORY_TRACKING flag is on (in wyBuildConfig.h)");
#endif
}
Ejemplo n.º 2
0
void wyDirector::commonDestroy() {
	g_Director_isEnding = true;

	// notify listener
	notifyDirectorEnded();
	
	// stop dispatch events and remove all handlers
	gEventDispatcher->setDispatchEvent(false);

	// remove all textures
	gTextureManager->removeAllTextures();

	// remove all actions
	gActionManager->removeAllActionsLocked();

	// release auto release pool
	wyDestroyAutoReleasePool();

	// free members
	wyObjectRelease(m_fpsLabel);
	if(m_runningScene != NULL) {
		m_runningScene->onExit();
		m_runningScene->cleanup();
	}
	if(m_screenshotPath != NULL) {
		wyFree((void*)m_screenshotPath);
		m_screenshotPath = NULL;
	}
	setRunningScene(NULL);
	setNextScene(NULL);
	wyArrayEach(m_scenesStack, releaseScene, NULL);
	wyArrayDestroy(m_scenesStack);
	wyArrayDestroy(m_lifecycleListeners);
	wyFree(m_clipStack);

	// clear singleton instance
	wyObjectRelease(gTextureManager);
	wyObjectRelease(gScheduler);
	wyObjectRelease(gEventDispatcher);
	wyObjectRelease(gActionManager);
	wyObjectRelease(gZwoptexManager);
	wyObjectRelease(gMWManager);
	wyObjectRelease(gSPXManager);
	wyObjectRelease(gSPX3Manager);
	wyObjectRelease(gArcticManager);
	wyObjectRelease(gAuroraManager);
	wyBitmapFont::unloadAll();
    wyToast::clear();

    // clear resource decoder
	gResDecoder = NULL;

	// now flush all existing auto release pool
	wyAutoReleasePool::flush();

	// free mutex
	pthread_mutex_destroy(&gMutex);
	pthread_mutex_destroy(&gCondMutex);
	
	// check leak
#ifdef WY_CFLAG_MEMORY_TRACKING
	wyOutputLeakPool();
	wyClearLeakPool();

	printUnreleasedMemory(true);
#endif
}
Ejemplo n.º 3
0
void wyDirector::printUnreleasedObjects() {
	wyOutputLeakPool();
}