Backbone.localStorage icon indicating copy to clipboard operation
Backbone.localStorage copied to clipboard

"RangeError: Maximum call stack size exceeded" when destroying twice the same model

Open ncortines opened this issue 9 years ago • 2 comments

Hi,

The issue is easy to reproduce. Simply invoke "destroy" twice in the same model.

I'm not saying it is correct invoking "destroy" twice on the same model, but in my opinion this should be better handled.

Thanks

ncortines avatar Oct 08 '14 12:10 ncortines

You're right. This command should be a noop after the first successful run or it should return a proper error.

jeromegn avatar Oct 08 '14 14:10 jeromegn

I just ran into this problem as well, though I cannot track down where multiple calls to destroy are happening. I have a remove listener set up on a collection which calls the destroy method on the removed model, and then everything goes crazy and I have a stack overflow.

killtheliterate avatar Jul 07 '15 22:07 killtheliterate