Make reset() safer if the new throws.
[dcpomatic.git] / src / wx / wx_ptr.h
index 24bccb0438a517b59a9c9a8b4d70c9149a87380c..fcca8b18bafb602744c9befb8ab5971bace1a7a7 100644 (file)
@@ -95,6 +95,7 @@ public:
        {
                if (_wx) {
                        _wx->Destroy();
+                       _wx = nullptr;
                }
                _wx = new T(std::forward<Args>(args)...);
        }