comparison Plugin/Plugin.cpp @ 147:70d1fe6d6309

Avoid hard crash if not enough memory
author Sebastien Jodogne <s.jodogne@gmail.com>
date Wed, 09 Nov 2016 12:43:58 +0100
parents 16f8471e3872
children 5dc54316d68b
comparison
equal deleted inserted replaced
146:3cde3e806abe 147:70d1fe6d6309
94 CacheContext(const std::string& path) : storage_(path), stop_(false) 94 CacheContext(const std::string& path) : storage_(path), stop_(false)
95 { 95 {
96 boost::filesystem::path p(path); 96 boost::filesystem::path p(path);
97 db_.Open((p / "cache.db").string()); 97 db_.Open((p / "cache.db").string());
98 98
99 cache_.reset(new OrthancPlugins::CacheManager(db_, storage_)); 99 cache_.reset(new OrthancPlugins::CacheManager(context_, db_, storage_));
100 //cache_->SetSanityCheckEnabled(true); // For debug 100 //cache_->SetSanityCheckEnabled(true); // For debug
101 101
102 scheduler_.reset(new OrthancPlugins::CacheScheduler(*cache_, 100)); 102 scheduler_.reset(new OrthancPlugins::CacheScheduler(*cache_, 100));
103 103
104 newInstancesThread_ = boost::thread(NewInstancesThread, this); 104 newInstancesThread_ = boost::thread(NewInstancesThread, this);