@@ -17635,7 +17635,7 @@ PropertiesFile::PropertiesFile (const File& f, const int millisecondsBeforeSavin | |||
|| (options_ & (storeAsBinary | storeAsCompressedBinary | storeAsXML)) == storeAsCompressedBinary | |||
|| (options_ & (storeAsBinary | storeAsCompressedBinary | storeAsXML)) == storeAsXML); | |||
ProcessScopedLock pl (getProcessLock()); | |||
ProcessScopedLock pl (createProcessLock()); | |||
ScopedPointer<InputStream> fileStream (f.createInputStream()); | |||
@@ -17717,9 +17717,9 @@ PropertiesFile::~PropertiesFile() | |||
jassertfalse; | |||
} | |||
PropertiesFile::ProcessScopedLock PropertiesFile::getProcessLock() const | |||
InterProcessLock::ScopedLockType* PropertiesFile::createProcessLock() const | |||
{ | |||
return ProcessScopedLock (processLock != 0 ? new InterProcessLock::ScopedLockType (*processLock) : 0); | |||
return processLock != 0 ? new InterProcessLock::ScopedLockType (*processLock) : 0; | |||
} | |||
bool PropertiesFile::saveIfNeeded() | |||
@@ -17771,7 +17771,7 @@ bool PropertiesFile::save() | |||
getAllProperties().getAllValues() [i]); | |||
} | |||
ProcessScopedLock pl (getProcessLock()); | |||
ProcessScopedLock pl (createProcessLock()); | |||
if (doc.writeToFile (file, String::empty)) | |||
{ | |||
@@ -17781,7 +17781,7 @@ bool PropertiesFile::save() | |||
} | |||
else | |||
{ | |||
ProcessScopedLock pl (getProcessLock()); | |||
ProcessScopedLock pl (createProcessLock()); | |||
TemporaryFile tempFile (file); | |||
ScopedPointer <OutputStream> out (tempFile.getFile().createOutputStream()); | |||
@@ -17887,7 +17887,7 @@ PropertiesFile* PropertiesFile::createDefaultAppPropertiesFile (const String& ap | |||
const bool commonToAllUsers, | |||
const int millisecondsBeforeSaving, | |||
const int propertiesFileOptions, | |||
InterProcessLock *processLock_) | |||
InterProcessLock* processLock_) | |||
{ | |||
const File file (getDefaultAppSettingsFile (applicationName, | |||
fileNameSuffix, | |||
@@ -3484,6 +3484,10 @@ private: | |||
// (Required as an alternative to the overloaded & operator). | |||
const ScopedPointer* getAddress() const throw() { return this; } | |||
// This is private to stop people accidentally copying a const ScopedPointer (the compiler | |||
// will let you do so by implicitly casting the source to its raw object pointer). | |||
ScopedPointer (const ScopedPointer&); | |||
}; | |||
template <class ObjectType> | |||
@@ -13480,7 +13484,7 @@ public: | |||
bool commonToAllUsers, | |||
int millisecondsBeforeSaving, | |||
int propertiesFileOptions, | |||
InterProcessLock *ipl = NULL); | |||
InterProcessLock* processLock = 0); | |||
static const File getDefaultAppSettingsFile (const String& applicationName, | |||
const String& fileNameSuffix, | |||
@@ -13500,8 +13504,8 @@ private: | |||
bool loadedOk, needsWriting; | |||
InterProcessLock* processLock; | |||
typedef ScopedPointer<InterProcessLock::ScopedLockType> ProcessScopedLock; | |||
ProcessScopedLock getProcessLock() const; | |||
typedef const ScopedPointer<InterProcessLock::ScopedLockType> ProcessScopedLock; | |||
InterProcessLock::ScopedLockType* createProcessLock() const; | |||
void timerCallback(); | |||
@@ -166,6 +166,10 @@ private: | |||
// (Required as an alternative to the overloaded & operator). | |||
const ScopedPointer* getAddress() const throw() { return this; } | |||
// This is private to stop people accidentally copying a const ScopedPointer (the compiler | |||
// will let you do so by implicitly casting the source to its raw object pointer). | |||
ScopedPointer (const ScopedPointer&); | |||
}; | |||
//============================================================================== | |||
@@ -69,7 +69,7 @@ PropertiesFile::PropertiesFile (const File& f, const int millisecondsBeforeSavin | |||
|| (options_ & (storeAsBinary | storeAsCompressedBinary | storeAsXML)) == storeAsCompressedBinary | |||
|| (options_ & (storeAsBinary | storeAsCompressedBinary | storeAsXML)) == storeAsXML); | |||
ProcessScopedLock pl (getProcessLock()); | |||
ProcessScopedLock pl (createProcessLock()); | |||
ScopedPointer<InputStream> fileStream (f.createInputStream()); | |||
@@ -151,9 +151,9 @@ PropertiesFile::~PropertiesFile() | |||
jassertfalse; | |||
} | |||
PropertiesFile::ProcessScopedLock PropertiesFile::getProcessLock() const | |||
InterProcessLock::ScopedLockType* PropertiesFile::createProcessLock() const | |||
{ | |||
return ProcessScopedLock (processLock != 0 ? new InterProcessLock::ScopedLockType (*processLock) : 0); | |||
return processLock != 0 ? new InterProcessLock::ScopedLockType (*processLock) : 0; | |||
} | |||
bool PropertiesFile::saveIfNeeded() | |||
@@ -205,7 +205,7 @@ bool PropertiesFile::save() | |||
getAllProperties().getAllValues() [i]); | |||
} | |||
ProcessScopedLock pl (getProcessLock()); | |||
ProcessScopedLock pl (createProcessLock()); | |||
if (doc.writeToFile (file, String::empty)) | |||
{ | |||
@@ -215,7 +215,7 @@ bool PropertiesFile::save() | |||
} | |||
else | |||
{ | |||
ProcessScopedLock pl (getProcessLock()); | |||
ProcessScopedLock pl (createProcessLock()); | |||
TemporaryFile tempFile (file); | |||
ScopedPointer <OutputStream> out (tempFile.getFile().createOutputStream()); | |||
@@ -322,7 +322,7 @@ PropertiesFile* PropertiesFile::createDefaultAppPropertiesFile (const String& ap | |||
const bool commonToAllUsers, | |||
const int millisecondsBeforeSaving, | |||
const int propertiesFileOptions, | |||
InterProcessLock *processLock_) | |||
InterProcessLock* processLock_) | |||
{ | |||
const File file (getDefaultAppSettingsFile (applicationName, | |||
fileNameSuffix, | |||
@@ -155,7 +155,7 @@ public: | |||
bool commonToAllUsers, | |||
int millisecondsBeforeSaving, | |||
int propertiesFileOptions, | |||
InterProcessLock *ipl = NULL); | |||
InterProcessLock* processLock = 0); | |||
/** Handy utility to choose a file in the standard OS-dependent location for application | |||
settings files. | |||
@@ -197,8 +197,8 @@ private: | |||
bool loadedOk, needsWriting; | |||
InterProcessLock* processLock; | |||
typedef ScopedPointer<InterProcessLock::ScopedLockType> ProcessScopedLock; | |||
ProcessScopedLock getProcessLock() const; | |||
typedef const ScopedPointer<InterProcessLock::ScopedLockType> ProcessScopedLock; | |||
InterProcessLock::ScopedLockType* createProcessLock() const; | |||
void timerCallback(); | |||