]> granicus.if.org Git - graphviz/commitdiff
visio plugin: manage _geom member of Graphic as a smart pointer
authorMatthew Fernandez <matthew.fernandez@gmail.com>
Thu, 8 Apr 2021 00:21:14 +0000 (17:21 -0700)
committerMatthew Fernandez <matthew.fernandez@gmail.com>
Sat, 17 Apr 2021 23:07:40 +0000 (16:07 -0700)
plugin/visio/VisioGraphic.cpp
plugin/visio/VisioGraphic.h

index f3d794aebfdc267d730896af4d3a30412918d5e5..33abae133f4c3ab0bb2e383efdc77d8d5a9cc7a8 100644 (file)
@@ -533,8 +533,6 @@ namespace Visio
        {
                if (_fill)
                        delete _fill;
-               if (_geom)
-                       delete _geom;
        }
 
        boxf Graphic::GetBounds() const
index 1e0313508c693070815300fc523245060b4dc357..99dc9f22df78af248af63c202108218bea51d9b1 100644 (file)
@@ -12,6 +12,7 @@
 #define VISIOGRAPHIC_H
 
 #include <common/types.h>
+#include <memory>
 
 namespace Visio
 {
@@ -166,7 +167,7 @@ namespace Visio
                
                Line _line;
                Fill* _fill;
-               Geom* _geom;
+               std::unique_ptr<Geom> _geom;
        };
 }