MCPcopy Create free account
hub / github.com/TorqueGameEngines/Torque3D / remove

Method remove

Engine/source/core/resourceManager.cpp:135–165  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

133#endif
134
135bool ResourceManager::remove( ResourceBase::Header* header )
136{
137 const Path &path = header->getPath();
138
139#ifdef TORQUE_DEBUG_RES_MANAGER
140 Con::printf( "ResourceManager::remove : [%s]", path.getFullPath().c_str() );
141#endif
142
143 ResourceHeaderMap::Iterator iter = mResourceHeaderMap.find( path.getFullPath() );
144 if ( iter != mResourceHeaderMap.end() && iter->value == header )
145 {
146 AssertISV( header && (header->getRefCount() == 0), "ResourceManager error: trying to remove resource which is still in use." );
147 mResourceHeaderMap.erase( iter );
148 }
149 else
150 {
151 iter = mPrevResourceHeaderMap.find( path.getFullPath() );
152 if ( iter == mPrevResourceHeaderMap.end() || iter->value != header )
153 {
154 Con::errorf( "ResourceManager::remove : Trying to remove non-existent resource [%s]", path.getFullPath().c_str() );
155 return false;
156 }
157
158 AssertISV( header && (header->getRefCount() == 0), "ResourceManager error: trying to remove resource which is still in use." );
159 mPrevResourceHeaderMap.erase( iter );
160 }
161
162 FS::RemoveChangeNotification( path, this, &ResourceManager::notifiedFileChanged );
163
164 return true;
165}
166
167void ResourceManager::notifiedFileChanged( const Torque::Path &path )
168{

Callers

nothing calls this directly

Calls 9

printfFunction · 0.85
RemoveChangeNotificationFunction · 0.85
errorfFunction · 0.50
getPathMethod · 0.45
c_strMethod · 0.45
findMethod · 0.45
endMethod · 0.45
getRefCountMethod · 0.45
eraseMethod · 0.45

Tested by

no test coverage detected