From d5af21ff96275a71e2ce802e6fdd7f46cd95ed06 Mon Sep 17 00:00:00 2001 From: Matthias Neeracher Date: Fri, 27 Apr 2007 03:56:25 +0000 Subject: [PATCH] Clear song before loading --- Sources/VLModel.h | 1 + Sources/VLXMLDocument.mm | 2 ++ 2 files changed, 3 insertions(+) diff --git a/Sources/VLModel.h b/Sources/VLModel.h index 79065c9..efaa1a3 100644 --- a/Sources/VLModel.h +++ b/Sources/VLModel.h @@ -264,6 +264,7 @@ struct VLRepeat { struct VLSong { VLSong(bool initialize = true); void swap(VLSong & other); + void clear(); std::vector fProperties; std::vector fMeasures; diff --git a/Sources/VLXMLDocument.mm b/Sources/VLXMLDocument.mm index 9a8c2fb..4fe3f93 100644 --- a/Sources/VLXMLDocument.mm +++ b/Sources/VLXMLDocument.mm @@ -679,6 +679,8 @@ int8_t sStepToPitch[] = { - (BOOL)readFromXMLData:(NSData *)data error:(NSError **)outError { + song->clear(); + NSXMLDocument * doc = [[NSXMLDocument alloc] initWithData:data options:0 error:outError];