Project

General

Profile

Bug #4553 ยป fix_msg_resources_segv.patch

Working patch - Mark O'Donovan, 11/06/2015 12:18 PM

View differences:

src/Wt/WMessageResources
#include <Wt/WMessageResourceBundle>
#include <Wt/WDllDefs.h>
#ifdef WT_THREADED
#include <boost/thread/condition.hpp>
namespace boost {
class mutex;
}
#endif // WT_THREADED
namespace Wt {
class WString;
......
unsigned pluralCount_;
};
#ifdef WT_THREADED
boost::shared_ptr<boost::mutex> dataMutex_;
#endif // WT_THREADED
Resource local_;
Resource defaults_;
src/Wt/WMessageResources.C
#include <boost/bind.hpp>
#ifdef WT_THREADED
#include <boost/thread/mutex.hpp>
#endif // WT_THREADED
namespace {
#if BOOST_VERSION < 103600
......
loaded_(false),
path_(path),
builtin_(0)
#ifdef WT_THREADED
,dataMutex_(new boost::mutex)
#endif // WT_THREADED
{ }
WMessageResources::WMessageResources(const char *builtin)
......
void WMessageResources::hibernate()
{
if (!loadInMemory_) {
#ifdef WT_THREADED
boost::mutex::scoped_lock lock(*dataMutex_);
#endif // WT_THREADED
defaults_.map_.clear();
local_.map_.clear();
loaded_ = false;
    (1-1/1)