FLTK logo

[master] 5b1c724 - Remove memory leak.

FLTK matrix user chat room
(using Element browser app)   FLTK gitter user chat room   GitHub FLTK Project   FLTK News RSS Feed  
  FLTK Apps      FLTK Library      Forums      Links     Login 
 All Forums  |  Back to fltk.commit  ]
 
Previous Message ]Next Message ]

[master] 5b1c724 - Remove memory leak. "ManoloFLTK" Aug 04, 2020  
 
commit 5b1c7249a5bc219f01ebc3e9b9cf64b678039de8
Author:     ManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com>
AuthorDate: Tue Aug 4 11:06:49 2020 +0200
Commit:     ManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com>
CommitDate: Tue Aug 4 11:06:59 2020 +0200

    Remove memory leak.

 src/drivers/SVG/Fl_SVG_File_Surface.cxx | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git src/drivers/SVG/Fl_SVG_File_Surface.cxx src/drivers/SVG/Fl_SVG_File_Surface.cxx
index 5106c64..8f5c4ec 100644
--- src/drivers/SVG/Fl_SVG_File_Surface.cxx
+++ src/drivers/SVG/Fl_SVG_File_Surface.cxx
@@ -212,8 +212,10 @@ void Fl_SVG_Graphics_Driver::compute_dasharray(float s, char *dashes) {
   }
   int dash_part = line_style_ & 0xFF;
   if (dash_part == FL_SOLID)  {
-    if (dasharray_ && strcmp(dasharray_, "none")) free(dasharray_);
-    dasharray_ = fl_strdup("none");
+    if (strcmp(dasharray_, "none")) {
+      if (dasharray_) free(dasharray_);
+      dasharray_ = fl_strdup("none");
+    }
   } else {
     int cap_part = (line_style_ & 0xF00);
     bool is_flat = (cap_part == FL_CAP_FLAT || cap_part == 0);
Direct Link to Message ]
 
     
Previous Message ]Next Message ]
 
 

Comments are owned by the poster. All other content is copyright 1998-2024 by Bill Spitzak and others. This project is hosted by The FLTK Team. Please report site problems to 'erco@seriss.com'.