prevent use-after-free.

This commit is contained in:
aliaspider committed 2018-03-22 22:10:05 +01:00
1 parent 2d1128db76
commit fc9a5ff65c
2 files changed
+6 -1

No files matched your search

+1
View File
@@ -176,6 +176,7 @@ void LogManager::ChangeFileLog(const char *filename) {
if (fileLog_) {
RemoveListener(fileLog_);
delete fileLog_;
fileLog_ = nullptr;
}
if (filename) {
+5 -1
View File
@@ -182,7 +182,11 @@ void TextureCacheVulkan::DeviceLost() {
}
samplerCache_.DeviceLost();
vulkan_->Delete().QueueDeleteSampler(samplerNearest_);
if(samplerNearest_) {
vulkan_->Delete().QueueDeleteSampler(samplerNearest_);
samplerNearest_ = VK_NULL_HANDLE;
}
nextTexture_ = nullptr;
}