diff --git a/src/dat/gui/GUI.js b/src/dat/gui/GUI.js index 024eaa0..3b8b199 100644 --- a/src/dat/gui/GUI.js +++ b/src/dat/gui/GUI.js @@ -563,9 +563,12 @@ define([ } dom.unbind(window, 'keydown', _keydownHandler, false); - dom.unbind(window, 'unload', saveToLocalStorage); dom.unbind(window, 'resize', _resizeHandler); + if (saveToLocalStorage) { + dom.unbind(window, 'unload', saveToLocalStorage); + } + }, /**