question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

How to perform clean remove/destroy

See original GitHub issue

I’m using the jQuery version, and I was hoping to find a method to cleanly destroy a Survey instance - unbinding any event handlers and so on:

$('#survey').Survey('destroy')' // or:
survey.destroy();

Care should be taken, so all DOM event handlers etc. are disposed to prevent any memory leaks in a SPA setup.

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Reactions:2
  • Comments:8 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
fabiencommented, Apr 10, 2018

Hi @dmitrykurmanov! setting innerHTML is not really the same thing. A proper destroy method should be implemented to dispose any DOM event handlers and so on, so a SPA doesn’t leak memory every time a new survey is created (and an old survey is not properly discarded).

1reaction
halexiev-hedgeservcommented, Mar 20, 2018

Hi guys,

Have any improvements been made regarding this?

What would be the best way to dispose of surveyjs in an angular cli app?

Moreover we have many different survey json models that we need to display at runtime depending on current selection so is there any best practice to replace current surveyjs model?

Thanks, Hristo

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to perform clean remove/destroy · Issue #241 · surveyjs ...
I'm using the jQuery version, and I was hoping to find a method to cleanly destroy a Survey instance - unbinding any event...
Read more >
Wiping drives clean, destroying hard drives, deleting all files
In this video I show several ways to delete files all the way from free software to drilling through a hard drives platters....
Read more >
Can't Get Clean Vagrant Box "Remove" or "Destroy"
Even so, I would expect the destroy command to acknowledge the existence of my windows_2012_r2_core box, given that the list and remove commands ......
Read more >
Search And Destroy Removal Instructions - Bleeping Computer
To remove Search And Destroy, follow these steps: ; STEP 1: Print out instructions before we begin. ; STEP 2: Use Rkill to...
Read more >
How to completely destroy the content of your disk and start ...
All data structures will be deleted including gpt and mbr! Remember these two commands that can help you when you want to remove...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found