From 59ad7b04f7f49a06e1476472d5a3fddc1d241685 Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Mon, 16 Jan 2023 01:13:25 +0100 Subject: [PATCH] Make reset() safer if the new throws. --- src/wx/wx_ptr.h | 1 + 1 file changed, 1 insertion(+) diff --git a/src/wx/wx_ptr.h b/src/wx/wx_ptr.h index 24bccb043..fcca8b18b 100644 --- a/src/wx/wx_ptr.h +++ b/src/wx/wx_ptr.h @@ -95,6 +95,7 @@ public: { if (_wx) { _wx->Destroy(); + _wx = nullptr; } _wx = new T(std::forward(args)...); } -- 2.30.2