speckle-server icon indicating copy to clipboard operation
speckle-server copied to clipboard

Dispose() method in Viewer.ts

Open saschabul opened this issue 1 year ago • 2 comments

Would be great to have Dispose() method in Viewer.ts implemented :)

saschabul avatar Apr 20 '23 13:04 saschabul

Any news about this?

We have a Vue3 web app with multiple routes.

When the viewer is loaded the first time it works fine: Screenshot_3

But after routing back to the same viewer component the shading breaks: Screenshot_4 We do the following

onBeforeUnmount(async () => {
  if (viewer) {
    await viewer.unloadAll();
    viewer.dispose();
  }
});

The current implementation of dispose() says // TODO: currently it's easier to simply refresh the page :)

Refreshing the page does solve the issue which can also be done with location.reload() but this causes a white page every time we change components.

Is there a better workaround? I tried using DebugViewer and disposing of the WebGLRenderer but with no luck.

Thanks.

Sticcia avatar Dec 11 '23 14:12 Sticcia

Thank you for letting us know about this issue. We'll look into it as soon as we have some bandwidth available

AlexandruPopovici avatar Dec 12 '23 12:12 AlexandruPopovici

Hi again, do you have any information about a possible workaround for this issue? How can we properly dispose of the Renderer ourselves?

Sticcia avatar Mar 19 '24 10:03 Sticcia

Hello @Sticcia

Thank you for your patience! We we will be looking into this issue in the following days and will surely come back with a resolution

Cheers

AlexandruPopovici avatar Apr 03 '24 13:04 AlexandruPopovici

Hi @Sticcia

We've merged in a fix for this issue and will be available in the next release soon!

Cheers

AlexandruPopovici avatar Apr 04 '24 12:04 AlexandruPopovici

Thank you so much for the great work!

Sticcia avatar Apr 04 '24 12:04 Sticcia