aboutsummaryrefslogtreecommitdiff
path: root/src/Cache.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/Cache.cpp')
-rw-r--r--src/Cache.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/Cache.cpp b/src/Cache.cpp
index 9039bd6..ae07f9d 100644
--- a/src/Cache.cpp
+++ b/src/Cache.cpp
@@ -103,7 +103,7 @@ namespace dchat
fprintf(stderr, "Failed to read binds from file, reason: %s\n", e.what());
}
- delete fileContent.data;
+ delete[] fileContent.data;
}
void Cache::replaceBindsInFile(const unordered_map<string, string> &binds)
@@ -311,15 +311,15 @@ namespace dchat
checkContentAccessTimeThread.join();
}
- static void replaceFileIgnoreError(const boost::filesystem::path &path)
+ static void createFileIgnoreError(const boost::filesystem::path &path)
{
try
{
- fileReplace(path, StringView());
+ fileReplace(path, StringView("", 0));
}
catch(FileException &e)
{
- fprintf(stderr, "Failed to replace file: %s, reason: %s\n", path.string().c_str(), e.what());
+ fprintf(stderr, "Failed to create empty file: %s, reason: %s\n", path.string().c_str(), e.what());
}
}
@@ -363,7 +363,7 @@ namespace dchat
return contentByUrlResult;
}
- replaceFileIgnoreError(downloadingFilepath);
+ createFileIgnoreError(downloadingFilepath);
ContentByUrlResult result((sf::Texture*)nullptr, ContentByUrlResult::Type::DOWNLOADING);
contentUrlCache[url] = result;