mirror of
https://github.com/microsoft/PowerToys.git
synced 2024-11-23 19:49:17 +08:00
[Analyzers][CPP] Turn on warning 26403 (#22795)
This commit is contained in:
parent
dd62dab831
commit
6287460614
@ -13,7 +13,7 @@
|
||||
<Rule Id="C26400" Action="Info" />
|
||||
<Rule Id="C26401" Action="Info" />
|
||||
<Rule Id="C26402" Action="Error" />
|
||||
<Rule Id="C26403" Action="Info" />
|
||||
<Rule Id="C26403" Action="Error" />
|
||||
<Rule Id="C26404" Action="Error" />
|
||||
<Rule Id="C26405" Action="Error" />
|
||||
<Rule Id="C26406" Action="Error" />
|
||||
|
@ -197,13 +197,9 @@ std::unique_ptr<D3DCaptureState> D3DCaptureState::Create(DxgiAPI* dxgiAPI,
|
||||
swapChain.put()));
|
||||
|
||||
// We must create the object in a heap, since we need to pin it in memory to receive callbacks
|
||||
auto statePtr = new D3DCaptureState{ dxgiAPI,
|
||||
std::move(swapChain),
|
||||
pixelFormat,
|
||||
std::move(monitorInfo),
|
||||
continuousCapture };
|
||||
auto statePtr = std::unique_ptr<D3DCaptureState>(new D3DCaptureState{ dxgiAPI, std::move(swapChain), pixelFormat, std::move(monitorInfo), continuousCapture });
|
||||
|
||||
return std::unique_ptr<D3DCaptureState>{ statePtr };
|
||||
return statePtr;
|
||||
}
|
||||
|
||||
D3DCaptureState::~D3DCaptureState()
|
||||
|
@ -319,7 +319,14 @@ VideoConferenceModule::VideoConferenceModule()
|
||||
if (_settingsUpdateChannel)
|
||||
{
|
||||
_settingsUpdateChannel->access([](auto memory) {
|
||||
|
||||
// Suppress warning 26403 - Reset or explicitly delete an owner<T> pointer 'variable' (r.3)
|
||||
// the video conference class should be only instantiated once and it is using placement new
|
||||
// the access to the data can be done through memory._data
|
||||
#pragma warning(push)
|
||||
#pragma warning(disable : 26403)
|
||||
auto updatesChannel = new (memory._data) CameraSettingsUpdateChannel{};
|
||||
#pragma warning(pop)
|
||||
});
|
||||
}
|
||||
sendSourceCameraNameUpdate();
|
||||
@ -520,11 +527,11 @@ void VideoConferenceModule::enable()
|
||||
{
|
||||
if (!_enabled)
|
||||
{
|
||||
_generalSettingsWatcher = std::make_unique<FileWatcher> (
|
||||
_generalSettingsWatcher = std::make_unique<FileWatcher>(
|
||||
PTSettingsHelper::get_powertoys_general_save_file_location(), [this] {
|
||||
toolbar.scheduleGeneralSettingsUpdate();
|
||||
toolbar.scheduleGeneralSettingsUpdate();
|
||||
});
|
||||
_moduleSettingsWatcher = std::make_unique<FileWatcher> (
|
||||
_moduleSettingsWatcher = std::make_unique<FileWatcher>(
|
||||
PTSettingsHelper::get_module_save_file_location(get_key()), [this] {
|
||||
toolbar.scheduleModuleSettingsUpdate();
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user