mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-01-10 04:07:25 -08:00
Merge pull request #274 from ctrlaltca/serva_memleaks
Removed a servatrice memleak
This commit is contained in:
@@ -29,6 +29,7 @@
|
||||
#include "server_logger.h"
|
||||
#include "rng_sfmt.h"
|
||||
#include "version_string.h"
|
||||
#include <google/protobuf/stubs/common.h>
|
||||
#ifdef Q_OS_UNIX
|
||||
#include <signal.h>
|
||||
#endif
|
||||
@@ -233,5 +234,8 @@ int main(int argc, char *argv[])
|
||||
loggerThread->wait();
|
||||
delete loggerThread;
|
||||
|
||||
// Delete all global objects allocated by libprotobuf.
|
||||
google::protobuf::ShutdownProtobufLibrary();
|
||||
|
||||
return retval;
|
||||
}
|
||||
|
||||
@@ -50,9 +50,9 @@ void ServerLogger::logMessage(QString message, void *caller)
|
||||
callerString = QString::number((qulonglong) caller, 16) + " ";
|
||||
|
||||
//filter out all log entries based on values in configuration file
|
||||
QSettings *settings = new QSettings("servatrice.ini", QSettings::IniFormat);
|
||||
bool shouldWeWriteLog = settings->value("server/writelog").toBool();
|
||||
QString logFilters = settings->value("server/logfilters").toString();
|
||||
QSettings settings("servatrice.ini", QSettings::IniFormat);
|
||||
bool shouldWeWriteLog = settings.value("server/writelog").toBool();
|
||||
QString logFilters = settings.value("server/logfilters").toString();
|
||||
QStringList listlogFilters = logFilters.split(",", QString::SkipEmptyParts);
|
||||
bool shouldWeSkipLine = false;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user