GGAudioManager::~GGAudioManager() { gevent_RemoveCallback(tick_s, this); delete soundManager_; deleteBackgroundMusicInterface(); systemCleanup(); }
~GGInputManager() { if (accelerometerStartCount_ > 0) stopAccelerometerHelper(); if (gyroscopeStartCount_ > 0) stopGyroscopeHelper(); gevent_RemoveCallbackWithGid(gid_); gevent_RemoveCallback(posttick_s, this); pthread_mutex_lock(&touchPoolMutex_); std::map<size_t, std::vector<ginput_TouchEvent*> >::iterator iter; for (iter = touchPool1_.begin(); iter != touchPool1_.end(); ++iter) { const std::vector<ginput_TouchEvent*> &v = iter->second; for (size_t i = 0; i < v.size(); ++i) { delete [] v[i]->allTouches; delete v[i]; } } for (iter = touchPool2_.begin(); iter != touchPool2_.end(); ++iter) { const std::vector<ginput_TouchEvent*> &v = iter->second; for (size_t i = 0; i < v.size(); ++i) { delete [] v[i]->allTouches; delete v[i]; } } pthread_mutex_unlock(&touchPoolMutex_); pthread_mutex_destroy(&touchPoolMutex_); pthread_mutex_lock(&keyPoolMutex_); for (size_t i = 0; i < keyPool1_.size(); ++i) delete keyPool1_[i]; for (size_t i = 0; i < keyPool2_.size(); ++i) delete keyPool2_[i]; pthread_mutex_unlock(&keyPoolMutex_); pthread_mutex_destroy(&keyPoolMutex_); pthread_mutex_lock(&mousePoolMutex_); for (size_t i = 0; i < mousePool1_.size(); ++i) delete mousePool1_[i]; for (size_t i = 0; i < mousePool2_.size(); ++i) delete mousePool2_[i]; pthread_mutex_unlock(&mousePoolMutex_); pthread_mutex_destroy(&mousePoolMutex_); }
GHID::~GHID() { gevent_RemoveCallback(onEnterFrame, this); Gamepad_shutdown(); std::map<int, GController*>::iterator iter, e = players.end(); for (iter = players.begin(); iter != e; ++iter) { delete iter->second; } players.clear(); gevent_RemoveEventsWithGid(gid_); }