mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-16 07:30:42 +01:00
Fix possible crash in VMapManager sLog.OutXX functions.
--HG-- branch : trunk
This commit is contained in:
@@ -299,11 +299,11 @@ namespace VMAP
|
||||
WorldModel *worldmodel = new WorldModel();
|
||||
if (!worldmodel->readFile(basepath + filename + ".vmo"))
|
||||
{
|
||||
sLog.outError("VMapManager2: could not load '%s%s.vmo'!", basepath, filename);
|
||||
sLog.outError("VMapManager2: could not load '%s%s.vmo'!", basepath.c_str(), filename.c_str());
|
||||
delete worldmodel;
|
||||
return NULL;
|
||||
}
|
||||
sLog.outDebug("VMapManager2: loading file '%s%s'.", basepath, filename);
|
||||
sLog.outDebug("VMapManager2: loading file '%s%s'.", basepath.c_str(), filename.c_str());
|
||||
model = iLoadedModelFiles.insert(std::pair<std::string, ManagedModel>(filename, ManagedModel())).first;
|
||||
model->second.setModel(worldmodel);
|
||||
}
|
||||
@@ -316,12 +316,12 @@ namespace VMAP
|
||||
ModelFileMap::iterator model = iLoadedModelFiles.find(filename);
|
||||
if (model == iLoadedModelFiles.end())
|
||||
{
|
||||
sLog.outError("VMapManager2: trying to unload non-loaded file '%s'!", filename);
|
||||
sLog.outError("VMapManager2: trying to unload non-loaded file '%s'!", filename.c_str());
|
||||
return;
|
||||
}
|
||||
if( model->second.decRefCount() == 0)
|
||||
{
|
||||
sLog.outDebug("VMapManager2: unloading file '%s'", filename);
|
||||
sLog.outDebug("VMapManager2: unloading file '%s'", filename.c_str());
|
||||
delete model->second.getModel();
|
||||
iLoadedModelFiles.erase(model);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user