# HG changeset patch # User Chris Cannam # Date 1404286953 -3600 # Node ID 0009b2b066e0276e892e4e0c2e2a4f2876d5f3ac # Parent 3be40cf40c492b9828c39fd8e6cf81995f462d96# Parent 5bd05a24e32a95a7a347b086d7904be92801586c Merge diff -r 3be40cf40c49 -r 0009b2b066e0 base/Debug.cpp --- a/base/Debug.cpp Wed Jul 02 08:42:11 2014 +0100 +++ b/base/Debug.cpp Wed Jul 02 08:42:33 2014 +0100 @@ -34,14 +34,16 @@ static QDebug *debug = 0; static QMutex mutex; static char *prefix; + mutex.lock(); + if (!debug) { prefix = new char[20]; sprintf(prefix, "[%lu]", (unsigned long)QCoreApplication::applicationPid()); QString pfx = ResourceFinder().getUserResourcePrefix(); QDir logdir(QString("%1/%2").arg(pfx).arg("log")); if (!logdir.exists()) logdir.mkpath(logdir.path()); - logFile = new QFile(logdir.path() + "/debug.log"); + logFile = new QFile(logdir.path() + "/sv-debug.log"); if (logFile->open(QIODevice::WriteOnly | QIODevice::Truncate)) { QDebug(QtDebugMsg) << (const char *)prefix << "Opened debug log file " @@ -59,10 +61,12 @@ *debug << endl << (const char *)prefix << "Log started at " << QDateTime::currentDateTime().toString(); } - mutex.unlock(); QDebug &dref = *debug; - return dref << endl << (const char *)prefix; + dref << endl << (const char *)prefix; + + mutex.unlock(); + return dref; } QDebug & diff -r 3be40cf40c49 -r 0009b2b066e0 data/model/EditableDenseThreeDimensionalModel.cpp --- a/data/model/EditableDenseThreeDimensionalModel.cpp Wed Jul 02 08:42:11 2014 +0100 +++ b/data/model/EditableDenseThreeDimensionalModel.cpp Wed Jul 02 08:42:33 2014 +0100 @@ -157,7 +157,7 @@ EditableDenseThreeDimensionalModel::getColumn(int index) const { QReadLocker locker(&m_lock); - if (int(index) >= m_data.size()) return Column(); + if (index < 0 || index >= m_data.size()) return Column(); return expandAndRetrieve(index); } @@ -390,7 +390,7 @@ QString EditableDenseThreeDimensionalModel::getBinName(int n) const { - if ((int)m_binNames.size() > n) return m_binNames[n]; + if (n >= 0 && (int)m_binNames.size() > n) return m_binNames[n]; else return ""; }