void Bitmap::ensureNonMega() const { if (isDisposed()) return; GUARD_MEGA; }
World::~World() { if (!isDisposed()) { dispose(); } }
bool World::_renameObject(Object* object, const String& name) { if (isDisposed()) return false; // Nothing to do yet return true; }
bool World::_attachObject(Object* object) { if (isDisposed()) return false; _attached.insert(object); return true; }
bool World::_detachObject(Object* object) { if (isDisposed()) return false; ObjectSet::iterator itr = _attached.find(object); _attached.erase(itr); return true; }
void Bitmap::flush() const { if (isDisposed()) return; if (p->megaSurface) return; p->flushPoints(); }
static void tr_core_dispose( GObject * obj ) { TrCore * core = TR_CORE( obj ); if( !isDisposed( core ) ) { GObjectClass * parent; core->priv = NULL; parent = g_type_class_peek( g_type_parent( TR_CORE_TYPE ) ); parent->dispose( obj ); } }
bool World::dispose() { if (isDisposed()) return true; _status = GWS_DISPOSING; for (ObjectSet::iterator itr = _attached.begin(), end = _attached.end(); itr != end; ++itr) { Object* obj = *itr; obj->_disposeByWorld(); } _attached.clear(); _status = GWS_DISPOSED; return true; }
Object* World::attach(const String& name, Object* obj) { if (isDisposed()) return NULL; if (obj == NULL) { LOG(0, "*** Cannot attach '%s' : object is null\n", name.c_str()); return NULL; } if (obj->isReactivating() || obj->isEditing()) { LOG(0, "*** Cannot attach '%s' : object is now busy\n", name.c_str()); return NULL; } if (obj->_world == this) return obj; if (obj->_world) { LOG(0, "*** Cannot attach '%s' : already attached to '%s'\n", name.c_str(), obj->_world->getName().c_str()); return NULL; } Ref<RefCounted> safe = obj; obj->_name = name; bool ok = _attachObject(obj); if (!ok) return NULL; obj->_world = this; g_Session->removeIsolated(obj); obj->_reactivateAll(); obj->onAttach(); return obj; }
D3DSampler::~D3DSampler(){ if (!isDisposed())Dispose(); }