Skip to content

Commit

Permalink
Fix memory leaks in tests (#803)
Browse files Browse the repository at this point in the history
* Free pointers in COM interface tests

* Free the returned BSTR in COM network test
  • Loading branch information
halildurmus committed Dec 19, 2023
1 parent b27171a commit e6f4240
Show file tree
Hide file tree
Showing 191 changed files with 380 additions and 26 deletions.
2 changes: 2 additions & 0 deletions test/com/iapplicationactivationmanager_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,6 @@ void main() {
test('Can instantiate IApplicationActivationManager.activateForProtocol', () {
expect(applicationactivationmanager.activateForProtocol, isA<Function>());
});

free(ptr);
}
2 changes: 2 additions & 0 deletions test/com/iappxfactory_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,6 @@ void main() {
test('Can instantiate IAppxFactory.createValidatedBlockMapReader', () {
expect(appxfactory.createValidatedBlockMapReader, isA<Function>());
});

free(ptr);
}
2 changes: 2 additions & 0 deletions test/com/iappxfile_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,6 @@ void main() {
test('Can instantiate IAppxFile.getStream', () {
expect(appxfile.getStream, isA<Function>());
});

free(ptr);
}
2 changes: 2 additions & 0 deletions test/com/iappxfilesenumerator_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,6 @@ void main() {
test('Can instantiate IAppxFilesEnumerator.moveNext', () {
expect(appxfilesenumerator.moveNext, isA<Function>());
});

free(ptr);
}
2 changes: 2 additions & 0 deletions test/com/iappxmanifestapplication_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,6 @@ void main() {
test('Can instantiate IAppxManifestApplication.getAppUserModelId', () {
expect(appxmanifestapplication.getAppUserModelId, isA<Function>());
});

free(ptr);
}
2 changes: 2 additions & 0 deletions test/com/iappxmanifestapplicationsenumerator_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,6 @@ void main() {
test('Can instantiate IAppxManifestApplicationsEnumerator.moveNext', () {
expect(appxmanifestapplicationsenumerator.moveNext, isA<Function>());
});

free(ptr);
}
2 changes: 2 additions & 0 deletions test/com/iappxmanifestospackagedependency_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,6 @@ void main() {
test('Can instantiate IAppxManifestOSPackageDependency.getVersion', () {
expect(appxmanifestospackagedependency.getVersion, isA<Function>());
});

free(ptr);
}
2 changes: 2 additions & 0 deletions test/com/iappxmanifestpackagedependenciesenumerator_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,6 @@ void main() {
() {
expect(appxmanifestpackagedependenciesenumerator.moveNext, isA<Function>());
});

free(ptr);
}
2 changes: 2 additions & 0 deletions test/com/iappxmanifestpackagedependency_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,6 @@ void main() {
test('Can instantiate IAppxManifestPackageDependency.getMinVersion', () {
expect(appxmanifestpackagedependency.getMinVersion, isA<Function>());
});

free(ptr);
}
2 changes: 2 additions & 0 deletions test/com/iappxmanifestpackageid_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -46,4 +46,6 @@ void main() {
test('Can instantiate IAppxManifestPackageId.getPackageFamilyName', () {
expect(appxmanifestpackageid.getPackageFamilyName, isA<Function>());
});

free(ptr);
}
2 changes: 2 additions & 0 deletions test/com/iappxmanifestproperties_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,6 @@ void main() {
test('Can instantiate IAppxManifestProperties.getStringValue', () {
expect(appxmanifestproperties.getStringValue, isA<Function>());
});

free(ptr);
}
2 changes: 2 additions & 0 deletions test/com/iappxmanifestreader2_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,6 @@ void main() {
test('Can instantiate IAppxManifestReader2.getQualifiedResources', () {
expect(appxmanifestreader2.getQualifiedResources, isA<Function>());
});

free(ptr);
}
2 changes: 2 additions & 0 deletions test/com/iappxmanifestreader3_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,6 @@ void main() {
test('Can instantiate IAppxManifestReader3.getTargetDeviceFamilies', () {
expect(appxmanifestreader3.getTargetDeviceFamilies, isA<Function>());
});

free(ptr);
}
2 changes: 2 additions & 0 deletions test/com/iappxmanifestreader4_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,6 @@ void main() {
test('Can instantiate IAppxManifestReader4.getOptionalPackageInfo', () {
expect(appxmanifestreader4.getOptionalPackageInfo, isA<Function>());
});

free(ptr);
}
2 changes: 2 additions & 0 deletions test/com/iappxmanifestreader5_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,6 @@ void main() {
test('Can instantiate IAppxManifestReader5.getMainPackageDependencies', () {
expect(appxmanifestreader5.getMainPackageDependencies, isA<Function>());
});

free(ptr);
}
2 changes: 2 additions & 0 deletions test/com/iappxmanifestreader6_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,6 @@ void main() {
expect(
appxmanifestreader6.getIsNonQualifiedResourcePackage, isA<Function>());
});

free(ptr);
}
2 changes: 2 additions & 0 deletions test/com/iappxmanifestreader7_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,6 @@ void main() {
test('Can instantiate IAppxManifestReader7.getHostRuntimeDependencies', () {
expect(appxmanifestreader7.getHostRuntimeDependencies, isA<Function>());
});

free(ptr);
}
2 changes: 2 additions & 0 deletions test/com/iappxmanifestreader_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -49,4 +49,6 @@ void main() {
test('Can instantiate IAppxManifestReader.getStream', () {
expect(appxmanifestreader.getStream, isA<Function>());
});

free(ptr);
}
2 changes: 2 additions & 0 deletions test/com/iappxpackagereader_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,6 @@ void main() {
test('Can instantiate IAppxPackageReader.getManifest', () {
expect(appxpackagereader.getManifest, isA<Function>());
});

free(ptr);
}
2 changes: 2 additions & 0 deletions test/com/iaudiocaptureclient_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,6 @@ void main() {
test('Can instantiate IAudioCaptureClient.getNextPacketSize', () {
expect(audiocaptureclient.getNextPacketSize, isA<Function>());
});

free(ptr);
}
2 changes: 2 additions & 0 deletions test/com/iaudioclient_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -58,4 +58,6 @@ void main() {
test('Can instantiate IAudioClient.getService', () {
expect(audioclient.getService, isA<Function>());
});

free(ptr);
}
2 changes: 2 additions & 0 deletions test/com/iaudioclock_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,6 @@ void main() {
test('Can instantiate IAudioClock.getCharacteristics', () {
expect(audioclock.getCharacteristics, isA<Function>());
});

free(ptr);
}
2 changes: 2 additions & 0 deletions test/com/iaudiorenderclient_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,6 @@ void main() {
test('Can instantiate IAudioRenderClient.releaseBuffer', () {
expect(audiorenderclient.releaseBuffer, isA<Function>());
});

free(ptr);
}
2 changes: 2 additions & 0 deletions test/com/iaudiosessioncontrol_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -54,4 +54,6 @@ void main() {
expect(audiosessioncontrol.unregisterAudioSessionNotification,
isA<Function>());
});

free(ptr);
}
2 changes: 2 additions & 0 deletions test/com/iaudiosessionmanager_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,6 @@ void main() {
test('Can instantiate IAudioSessionManager.getSimpleAudioVolume', () {
expect(audiosessionmanager.getSimpleAudioVolume, isA<Function>());
});

free(ptr);
}
2 changes: 2 additions & 0 deletions test/com/iaudiostreamvolume_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,6 @@ void main() {
test('Can instantiate IAudioStreamVolume.getAllVolumes', () {
expect(audiostreamvolume.getAllVolumes, isA<Function>());
});

free(ptr);
}
2 changes: 2 additions & 0 deletions test/com/ibindctx_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -52,4 +52,6 @@ void main() {
test('Can instantiate IBindCtx.revokeObjectParam', () {
expect(bindctx.revokeObjectParam, isA<Function>());
});

free(ptr);
}
2 changes: 2 additions & 0 deletions test/com/ichannelaudiovolume_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,6 @@ void main() {
test('Can instantiate IChannelAudioVolume.getAllVolumes', () {
expect(channelaudiovolume.getAllVolumes, isA<Function>());
});

free(ptr);
}
2 changes: 2 additions & 0 deletions test/com/iclassfactory_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,6 @@ void main() {
test('Can instantiate IClassFactory.lockServer', () {
expect(classfactory.lockServer, isA<Function>());
});

free(ptr);
}
2 changes: 2 additions & 0 deletions test/com/iconnectionpoint_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,6 @@ void main() {
test('Can instantiate IConnectionPoint.enumConnections', () {
expect(connectionpoint.enumConnections, isA<Function>());
});

free(ptr);
}
2 changes: 2 additions & 0 deletions test/com/iconnectionpointcontainer_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,6 @@ void main() {
test('Can instantiate IConnectionPointContainer.findConnectionPoint', () {
expect(connectionpointcontainer.findConnectionPoint, isA<Function>());
});

free(ptr);
}
2 changes: 2 additions & 0 deletions test/com/idesktopwallpaper_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -70,4 +70,6 @@ void main() {
test('Can instantiate IDesktopWallpaper.enable', () {
expect(desktopwallpaper.enable, isA<Function>());
});

free(ptr);
}
2 changes: 2 additions & 0 deletions test/com/idispatch_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,6 @@ void main() {
test('Can instantiate IDispatch.invoke', () {
expect(dispatch.invoke, isA<Function>());
});

free(ptr);
}
2 changes: 2 additions & 0 deletions test/com/ienumidlist_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,6 @@ void main() {
test('Can instantiate IEnumIDList.clone', () {
expect(enumidlist.clone, isA<Function>());
});

free(ptr);
}
2 changes: 2 additions & 0 deletions test/com/ienummoniker_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,6 @@ void main() {
test('Can instantiate IEnumMoniker.clone', () {
expect(enummoniker.clone, isA<Function>());
});

free(ptr);
}
2 changes: 2 additions & 0 deletions test/com/ienumnetworkconnections_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,6 @@ void main() {
test('Can instantiate IEnumNetworkConnections.clone', () {
expect(enumnetworkconnections.clone, isA<Function>());
});

free(ptr);
}
2 changes: 2 additions & 0 deletions test/com/ienumnetworks_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,6 @@ void main() {
test('Can instantiate IEnumNetworks.clone', () {
expect(enumnetworks.clone, isA<Function>());
});

free(ptr);
}
2 changes: 2 additions & 0 deletions test/com/ienumresources_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,6 @@ void main() {
test('Can instantiate IEnumResources.clone', () {
expect(enumresources.clone, isA<Function>());
});

free(ptr);
}
2 changes: 2 additions & 0 deletions test/com/ienumspellingerror_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,6 @@ void main() {
test('Can instantiate IEnumSpellingError.next', () {
expect(enumspellingerror.next, isA<Function>());
});

free(ptr);
}
2 changes: 2 additions & 0 deletions test/com/ienumstring_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,6 @@ void main() {
test('Can instantiate IEnumString.clone', () {
expect(enumstring.clone, isA<Function>());
});

free(ptr);
}
2 changes: 2 additions & 0 deletions test/com/ienumvariant_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,6 @@ void main() {
test('Can instantiate IEnumVARIANT.clone', () {
expect(enumvariant.clone, isA<Function>());
});

free(ptr);
}
2 changes: 2 additions & 0 deletions test/com/ienumwbemclassobject_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,6 @@ void main() {
test('Can instantiate IEnumWbemClassObject.skip', () {
expect(enumwbemclassobject.skip, isA<Function>());
});

free(ptr);
}
2 changes: 2 additions & 0 deletions test/com/ierrorinfo_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,6 @@ void main() {
test('Can instantiate IErrorInfo.getHelpContext', () {
expect(errorinfo.getHelpContext, isA<Function>());
});

free(ptr);
}
2 changes: 2 additions & 0 deletions test/com/ifiledialog2_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,6 @@ void main() {
test('Can instantiate IFileDialog2.setNavigationRoot', () {
expect(filedialog2.setNavigationRoot, isA<Function>());
});

free(ptr);
}
2 changes: 2 additions & 0 deletions test/com/ifiledialog_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -91,4 +91,6 @@ void main() {
test('Can instantiate IFileDialog.setFilter', () {
expect(filedialog.setFilter, isA<Function>());
});

free(ptr);
}
2 changes: 2 additions & 0 deletions test/com/ifiledialogcustomize_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -103,4 +103,6 @@ void main() {
test('Can instantiate IFileDialogCustomize.setControlItemText', () {
expect(filedialogcustomize.setControlItemText, isA<Function>());
});

free(ptr);
}
2 changes: 2 additions & 0 deletions test/com/ifileisinuse_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,6 @@ void main() {
test('Can instantiate IFileIsInUse.closeFile', () {
expect(fileisinuse.closeFile, isA<Function>());
});

free(ptr);
}
2 changes: 2 additions & 0 deletions test/com/ifileopendialog_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,6 @@ void main() {
test('Can instantiate IFileOpenDialog.getSelectedItems', () {
expect(fileopendialog.getSelectedItems, isA<Function>());
});

free(ptr);
}
2 changes: 2 additions & 0 deletions test/com/ifilesavedialog_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,6 @@ void main() {
test('Can instantiate IFileSaveDialog.applyProperties', () {
expect(filesavedialog.applyProperties, isA<Function>());
});

free(ptr);
}
2 changes: 2 additions & 0 deletions test/com/iinitializewithwindow_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,6 @@ void main() {
test('Can instantiate IInitializeWithWindow.initialize', () {
expect(initializewithwindow.initialize, isA<Function>());
});

free(ptr);
}
2 changes: 2 additions & 0 deletions test/com/iinspectable_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,6 @@ void main() {
test('Can instantiate IInspectable.getTrustLevel', () {
expect(inspectable.getTrustLevel, isA<Function>());
});

free(ptr);
}
2 changes: 2 additions & 0 deletions test/com/iknownfolder_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -49,4 +49,6 @@ void main() {
test('Can instantiate IKnownFolder.getFolderDefinition', () {
expect(knownfolder.getFolderDefinition, isA<Function>());
});

free(ptr);
}
2 changes: 2 additions & 0 deletions test/com/iknownfoldermanager_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -52,4 +52,6 @@ void main() {
test('Can instantiate IKnownFolderManager.redirect', () {
expect(knownfoldermanager.redirect, isA<Function>());
});

free(ptr);
}
2 changes: 2 additions & 0 deletions test/com/imetadataassemblyimport_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -65,4 +65,6 @@ void main() {
test('Can instantiate IMetaDataAssemblyImport.findAssembliesByName', () {
expect(metadataassemblyimport.findAssembliesByName, isA<Function>());
});

free(ptr);
}
2 changes: 2 additions & 0 deletions test/com/imetadatadispenser_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,6 @@ void main() {
test('Can instantiate IMetaDataDispenser.openScopeOnMemory', () {
expect(metadatadispenser.openScopeOnMemory, isA<Function>());
});

free(ptr);
}
2 changes: 2 additions & 0 deletions test/com/imetadatadispenserex_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,6 @@ void main() {
test('Can instantiate IMetaDataDispenserEx.findAssemblyModule', () {
expect(metadatadispenserex.findAssemblyModule, isA<Function>());
});

free(ptr);
}
2 changes: 2 additions & 0 deletions test/com/imetadataimport2_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -46,4 +46,6 @@ void main() {
test('Can instantiate IMetaDataImport2.enumMethodSpecs', () {
expect(metadataimport2.enumMethodSpecs, isA<Function>());
});

free(ptr);
}

0 comments on commit e6f4240

Please sign in to comment.