fix possible exception sites

This commit is contained in:
yuyoyuppe
2020-10-14 13:52:55 +03:00
parent d2913bc249
commit 8611a9a29a
3 changed files with 6 additions and 5 deletions

View File

@@ -18,7 +18,7 @@
#include "Logging.h"
IWICImagingFactory* _GetWIC()
IWICImagingFactory* _GetWIC() noexcept
{
static IWICImagingFactory* s_Factory = nullptr;
@@ -44,7 +44,7 @@ IWICImagingFactory* _GetWIC()
using Microsoft::WRL::ComPtr;
ComPtr<IMFSample> LoadImageAsSample(ComPtr<IStream> imageStream, IMFMediaType* sampleMediaType)
ComPtr<IMFSample> LoadImageAsSample(ComPtr<IStream> imageStream, IMFMediaType* sampleMediaType) noexcept
{
HRESULT hr = S_OK;

View File

@@ -11,4 +11,4 @@
#include <stdint.h>
#pragma warning(pop)
Microsoft::WRL::ComPtr<IMFSample> LoadImageAsSample(Microsoft::WRL::ComPtr<IStream> imageStream, IMFMediaType* outputSampleMediaType);
Microsoft::WRL::ComPtr<IMFSample> LoadImageAsSample(Microsoft::WRL::ComPtr<IStream> imageStream, IMFMediaType* outputSampleMediaType) noexcept;

View File

@@ -14,10 +14,11 @@ constexpr inline size_t maxLogSizeMegabytes = 10;
void LogToFile(std::string what, const bool verbose)
{
const auto tempPath = std::filesystem::temp_directory_path();
std::error_code _;
const auto tempPath = std::filesystem::temp_directory_path(_);
if (verbose)
{
const bool verboseIndicatorFilePresent = std::filesystem::exists(tempPath / L"PowerToysVideoConferenceVerbose.flag");
const bool verboseIndicatorFilePresent = std::filesystem::exists(tempPath / L"PowerToysVideoConferenceVerbose.flag", _);
if (!verboseIndicatorFilePresent)
{
return;