Changeset 117

Show
Ignore:
Timestamp:
02/07/08 04:14:29 (1 year ago)
Author:
mike
Message:

[fix] QDocument removed 2 memory leaks

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/QDocument/QDocument.m

    r116 r117  
    5454        cpuUsage = 0.0; 
    5555        ideActivity = FALSE; 
    56         driveFileNames = [[NSMutableArray arrayWithObjects:@"", @"", @"", nil] retain]; 
     56        driveFileNames = [[NSMutableArray alloc] initWithObjects:@"", @"", @"", nil]; 
    5757        absolute_enabled = FALSE; 
    5858        VMSupportsSnapshots = FALSE; 
     
    159159    if (fileTypes) 
    160160        [fileTypes release]; 
     161    if (driveFileNames) 
     162                [driveFileNames release]; 
    161163    if([[NSFileManager defaultManager] fileExistsAtPath:[NSString stringWithFormat:@"/tmp/qDocument_%D.vga", uniqueDocumentID]]) 
    162164        [[NSFileManager defaultManager] removeFileAtPath:[NSString stringWithFormat:@"/tmp/qDocument_%D.vga", uniqueDocumentID] handler: nil]; 
     
    283285                (*callback)(canCloseDocumentContext->delegate, canCloseDocumentContext->shouldCloseSelector, self, canCloseDocumentClose, canCloseDocumentContext->contextInfo); 
    284286        } 
     287        free(canCloseDocumentContext); 
    285288} 
    286289 
  • trunk/QShared/QQvmManager.m

    r116 r117  
    101101        NSMutableString *argument; 
    102102        NSString *option; 
    103         NSString *name; 
    104         int nameIndex; 
    105103 
    106104        data = [NSData dataWithContentsOfFile:[NSString stringWithFormat:@"%@/configuration.plist", filename]];