Commit 92b399e6 authored by Joel Collins's avatar Joel Collins
Browse files

Remove global event listeners before destroy

parent b557b4a7
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -261,6 +261,10 @@ export default {
  },

  beforeDestroy() {
    // Remove global signal listener to perform a gallery refresh
    this.$root.$off("globalUpdateCaptureList");
    // Remove global signal listener to set the gallery folder
    this.$root.$off("globalUpdateCaptureFolder");
    // Then we call that function here to unwatch
    if (this.unwatchStoreFunction) {
      this.unwatchStoreFunction();
+4 −0
Original line number Diff line number Diff line
@@ -103,6 +103,10 @@ export default {
  },

  beforeDestroy: function() {
    // Remove global signal listener to change the GPU preview state
    this.$root.$off("globalTogglePreview");
    // Remove global signal listener to flash the stream element
    this.$root.$off("globalFlashStream");
    // Disconnect the size observer
    this.sizeObserver.disconnect();
  },