Skip to content

Commit

Permalink
fix(memory leak): array buffer was sticking around because of excepti…
Browse files Browse the repository at this point in the history
…on (#748)
  • Loading branch information
sedghi authored Aug 21, 2023
1 parent 051092e commit f27ae9a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions packages/core/examples/volumeAPI/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -279,10 +279,10 @@ async function run() {
// Get Cornerstone imageIds and fetch metadata into RAM
const imageIds = await createImageIdsAndCacheMetaData({
StudyInstanceUID:
'1.3.6.1.4.1.14519.5.2.1.7009.2403.334240657131972136850343327463',
'1.3.6.1.4.1.14519.5.2.1.7009.2403.871108593056125491804754960339',
SeriesInstanceUID:
'1.3.6.1.4.1.14519.5.2.1.7009.2403.226151125820845824875394858561',
wadoRsRoot: 'https://d3t6nz73ql33tx.cloudfront.net/dicomweb',
'1.3.6.1.4.1.14519.5.2.1.7009.2403.367700692008930469189923116409',
wadoRsRoot: 'https://d33do7qe4w26qo.cloudfront.net/dicomweb',
});

// Instantiate a rendering engine
Expand Down
6 changes: 3 additions & 3 deletions packages/core/src/cache/classes/ImageVolume.ts
Original file line number Diff line number Diff line change
Expand Up @@ -151,12 +151,12 @@ export class ImageVolume implements IImageVolume {
*/
destroy(): void {
// TODO: GPU memory associated with volume is not cleared.
this.vtkOpenGLTexture.releaseGraphicsResources();
this.vtkOpenGLTexture.destroyTexture();
this.vtkOpenGLTexture.delete();
this.imageData.delete();
this.imageData = null;
this.scalarData = null;

this.vtkOpenGLTexture.releaseGraphicsResources();
this.vtkOpenGLTexture.delete();
}
}

Expand Down

0 comments on commit f27ae9a

Please sign in to comment.