Skip to content

Commit

Permalink
Fix crash on empty / unexisting path
Browse files Browse the repository at this point in the history
- This is a bit hacky, but does not add overhead
  • Loading branch information
visuve committed Mar 10, 2024
1 parent af89481 commit 73e80f0
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions PictureBrowser/ImageCache.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@ namespace PictureBrowser
}

ImageCache::ImageCache(bool useCaching) :
_useCaching(useCaching)
_useCaching(useCaching),
_cache({ { L"", nullptr } })
{
HRESULT hr = CoCreateInstance(
CLSID_WICImagingFactory,
Expand Down Expand Up @@ -99,7 +100,7 @@ namespace PictureBrowser

void ImageCache::Clear()
{
_cache.clear();
_cache = { { L"", nullptr } };
}

// TODO: this method should be cleaned up a bit.
Expand Down

0 comments on commit 73e80f0

Please sign in to comment.