* Fixed MDH log spam
This commit is contained in:
parent
511e28af22
commit
a3df2d8a99
@ -131,7 +131,7 @@ namespace MemoryDataHolder
|
|||||||
}
|
}
|
||||||
~DataLoaderRunnable()
|
~DataLoaderRunnable()
|
||||||
{
|
{
|
||||||
logdev("~DataLoaderRunnable(%s) 0x%X", _name.c_str(), this);
|
DEBUG(logdev("~DataLoaderRunnable(%s) 0x%X", _name.c_str(), this));
|
||||||
}
|
}
|
||||||
void SetStores(TypeStorage<memblock> *mem, TypeStorage<DataLoaderRunnable> *ldrs)
|
void SetStores(TypeStorage<memblock> *mem, TypeStorage<DataLoaderRunnable> *ldrs)
|
||||||
{
|
{
|
||||||
@ -153,7 +153,7 @@ namespace MemoryDataHolder
|
|||||||
delete mb;
|
delete mb;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
logdev("DataLoaderRunnable: Reading From MPQ'%s'... (%s)", _name.c_str(), FilesizeFormat(mb->size).c_str());
|
DEBUG(logdev("DataLoaderRunnable: Reading From MPQ'%s'... (%s)", _name.c_str(), FilesizeFormat(mb->size).c_str()));
|
||||||
const ByteBuffer& bb = mpq.ExtractFile(_name.c_str());
|
const ByteBuffer& bb = mpq.ExtractFile(_name.c_str());
|
||||||
// fh.read((char*)mb->ptr, mb->size);
|
// fh.read((char*)mb->ptr, mb->size);
|
||||||
if(!bb.size())
|
if(!bb.size())
|
||||||
@ -175,7 +175,7 @@ namespace MemoryDataHolder
|
|||||||
_storage->Assign(_name, mb);
|
_storage->Assign(_name, mb);
|
||||||
_loaders->Unlink(_name); // must be unlinked after the file is fully loaded, but before the callbacks are processed!
|
_loaders->Unlink(_name); // must be unlinked after the file is fully loaded, but before the callbacks are processed!
|
||||||
}
|
}
|
||||||
logdev("DataLoaderRunnable: Done with '%s' (%s)", _name.c_str(), FilesizeFormat(mb->size).c_str());
|
DEBUG(logdev("DataLoaderRunnable: Done with '%s' (%s)", _name.c_str(), FilesizeFormat(mb->size).c_str()));
|
||||||
DoCallbacks(_name, MDH_FILE_OK | MDH_FILE_JUST_LOADED);
|
DoCallbacks(_name, MDH_FILE_OK | MDH_FILE_JUST_LOADED);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -208,7 +208,7 @@ namespace MemoryDataHolder
|
|||||||
DoCallbacks(_name, MDH_FILE_ERROR);
|
DoCallbacks(_name, MDH_FILE_ERROR);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
logdev("DataLoaderRunnable: Reading '%s'... (%s)", _name.c_str(), FilesizeFormat(mb->size).c_str());
|
DEBUG(logdev("DataLoaderRunnable: Reading '%s'... (%s)", _name.c_str(), FilesizeFormat(mb->size).c_str()));
|
||||||
fh.read((char*)mb->ptr, mb->size);
|
fh.read((char*)mb->ptr, mb->size);
|
||||||
fh.close();
|
fh.close();
|
||||||
{
|
{
|
||||||
@ -216,7 +216,7 @@ namespace MemoryDataHolder
|
|||||||
_storage->Assign(_name, mb);
|
_storage->Assign(_name, mb);
|
||||||
_loaders->Unlink(_name); // must be unlinked after the file is fully loaded, but before the callbacks are processed!
|
_loaders->Unlink(_name); // must be unlinked after the file is fully loaded, but before the callbacks are processed!
|
||||||
}
|
}
|
||||||
logdev("DataLoaderRunnable: Done with '%s' (%s)", _name.c_str(), FilesizeFormat(mb->size).c_str());
|
DEBUG(logdev("DataLoaderRunnable: Done with '%s' (%s)", _name.c_str(), FilesizeFormat(mb->size).c_str()));
|
||||||
DoCallbacks(_name, MDH_FILE_OK | MDH_FILE_JUST_LOADED);
|
DoCallbacks(_name, MDH_FILE_OK | MDH_FILE_JUST_LOADED);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -372,14 +372,14 @@ namespace MemoryDataHolder
|
|||||||
{
|
{
|
||||||
if(*refcount > 0)
|
if(*refcount > 0)
|
||||||
(*refcount)--;
|
(*refcount)--;
|
||||||
logdev("MemoryDataHolder::Delete(\"%s\"): refcount dropped to %u", s.c_str(), *refcount);
|
DEBUG(logdev("MemoryDataHolder::Delete(\"%s\"): refcount dropped to %u", s.c_str(), *refcount));
|
||||||
}
|
}
|
||||||
if(!*refcount)
|
if(!*refcount)
|
||||||
{
|
{
|
||||||
refs.Delete(s);
|
refs.Delete(s);
|
||||||
if(memblock *mb = storage.GetNoCreate(s))
|
if(memblock *mb = storage.GetNoCreate(s))
|
||||||
{
|
{
|
||||||
logdev("MemoryDataHolder:: deleting 0x%X (size %s)", mb->ptr, FilesizeFormat(mb->size).c_str());
|
DEBUG(logdev("MemoryDataHolder:: deleting 0x%X (size %s)", mb->ptr, FilesizeFormat(mb->size).c_str()));
|
||||||
mb->free();
|
mb->free();
|
||||||
storage.Delete(s);
|
storage.Delete(s);
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user