]> Dogcows Code - chaz/openbox/blobdiff - src/Resource.cc
fixed memory leaks for strftime_format and rootcommand
[chaz/openbox] / src / Resource.cc
index f3b0e5f9ef3bfb50f0f57d6376f91bbb0b573901..2a678f89dafde320e75491ca3741599e424a84ba 100644 (file)
@@ -85,6 +85,13 @@ bool Resource::load() {
   return true;
 }
 
+void Resource::create() {
+  if (m_database != NULL)
+    XrmDestroyDatabase(m_database);
+  m_modified = false;
+  ASSERT(NULL != (m_database = XrmGetStringDatabase("")));
+}
+
 void Resource::setValue(const std::string &rname, bool value) {
   ASSERT(m_database != NULL);
 
@@ -116,6 +123,7 @@ void Resource::setValue(const std::string &rname, long value) {
 
 void Resource::setValue(const std::string &rname, const char *value) {
   ASSERT(m_database != NULL);
+  ASSERT(value != NULL);
   
   std::string rc_string = rname + ": " + value;
   XrmPutLineResource(&m_database, rc_string.c_str());
This page took 0.020879 seconds and 4 git commands to generate.