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];