fix memory leak in Cuesheet destructor
authorJosh Coalson <jcoalson@users.sourceforce.net>
Fri, 27 Dec 2002 21:05:18 +0000 (21:05 +0000)
committerJosh Coalson <jcoalson@users.sourceforce.net>
Fri, 27 Dec 2002 21:05:18 +0000 (21:05 +0000)
src/libFLAC++/metadata.cpp

index 2b6c85e..411ada6 100644 (file)
@@ -763,13 +763,15 @@ namespace FLAC {
 
                void CueSheet::Track::operator=(const Track &track)
                {
+                       if(0 != object_)
+                               free(object_);
                        object_ = ::FLAC__metadata_object_cuesheet_track_clone(track.object_);
                }
 
                CueSheet::Track::~Track()
                {
                        if(0 != object_)
-                               delete object_;
+                               free(object_);
                }
 
                bool CueSheet::Track::is_valid() const