]> granicus.if.org Git - graphviz/commitdiff
visio plugin: manage _fill member of Graphic as a smart pointer
authorMatthew Fernandez <matthew.fernandez@gmail.com>
Thu, 8 Apr 2021 00:25:25 +0000 (17:25 -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 33abae133f4c3ab0bb2e383efdc77d8d5a9cc7a8..26fabb27da31ecd4dcabdf9a6c5fecaa2709e9b1 100644 (file)
@@ -529,12 +529,6 @@ namespace Visio
        {
        }
        
-       Graphic::~Graphic()
-       {
-               if (_fill)
-                       delete _fill;
-       }
-
        boxf Graphic::GetBounds() const
        {
                return _geom->GetBounds();
index 99dc9f22df78af248af63c202108218bea51d9b1..42d16ecdb1d8ddb9e1260e96d00db2d7fe2c8a63 100644 (file)
@@ -155,8 +155,6 @@ namespace Visio
                static Graphic* CreatePolygon(GVJ_t* job, pointf* A, int n, bool filled);
                static Graphic* CreatePolyline(GVJ_t* job, pointf* A, int n);
                
-               ~Graphic();
-
                boxf GetBounds() const;
                const Connection* GetConnection() const;
 
@@ -166,7 +164,7 @@ namespace Visio
                Graphic(const Line &line, Fill* fill, Geom* geom);
                
                Line _line;
-               Fill* _fill;
+               std::unique_ptr<Fill> _fill;
                std::unique_ptr<Geom> _geom;
        };
 }