Clear song before loading

This commit is contained in:
Matthias Neeracher 2007-04-27 03:56:25 +00:00
parent c964bb0b00
commit d5af21ff96
2 changed files with 3 additions and 0 deletions

View File

@ -264,6 +264,7 @@ struct VLRepeat {
struct VLSong { struct VLSong {
VLSong(bool initialize = true); VLSong(bool initialize = true);
void swap(VLSong & other); void swap(VLSong & other);
void clear();
std::vector<VLProperties> fProperties; std::vector<VLProperties> fProperties;
std::vector<VLMeasure> fMeasures; std::vector<VLMeasure> fMeasures;

View File

@ -679,6 +679,8 @@ int8_t sStepToPitch[] = {
- (BOOL)readFromXMLData:(NSData *)data error:(NSError **)outError - (BOOL)readFromXMLData:(NSData *)data error:(NSError **)outError
{ {
song->clear();
NSXMLDocument * doc = [[NSXMLDocument alloc] initWithData:data NSXMLDocument * doc = [[NSXMLDocument alloc] initWithData:data
options:0 options:0
error:outError]; error:outError];