diff options
Diffstat (limited to 'src/FbTk/Resource.cc')
-rw-r--r-- | src/FbTk/Resource.cc | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/FbTk/Resource.cc b/src/FbTk/Resource.cc index cb45eac..3b857de 100644 --- a/src/FbTk/Resource.cc +++ b/src/FbTk/Resource.cc | |||
@@ -107,7 +107,15 @@ bool ResourceManager::load(const char *filename) { | |||
107 | */ | 107 | */ |
108 | bool ResourceManager::save(const char *filename, const char *mergefilename) { | 108 | bool ResourceManager::save(const char *filename, const char *mergefilename) { |
109 | assert(filename); | 109 | assert(filename); |
110 | filename = StringUtil::expandFilename(filename).c_str(); | 110 | |
111 | // these must be local variables; otherwise, the memory gets released by | ||
112 | // std::string, causing weird issues | ||
113 | string file_str = StringUtil::expandFilename(filename), mergefile_str; | ||
114 | filename = file_str.c_str(); | ||
115 | if (mergefilename) { | ||
116 | mergefile_str = StringUtil::expandFilename(mergefilename); | ||
117 | mergefilename = mergefile_str.c_str(); | ||
118 | } | ||
111 | 119 | ||
112 | // empty database | 120 | // empty database |
113 | XrmDatabaseHelper database; | 121 | XrmDatabaseHelper database; |