瀏覽代碼

Spreadsheet: Clear callbacks on persistent widgets before tearing tabs down

Otherwise changes to the widgets would cause all sorts of updates on
half-deleted cells.
Fixes #4171.
AnotherTest 4 年之前
父節點
當前提交
b532b2d3ca
共有 1 個文件被更改,包括 5 次插入0 次删除
  1. 5 0
      Applications/Spreadsheet/SpreadsheetWidget.cpp

+ 5 - 0
Applications/Spreadsheet/SpreadsheetWidget.cpp

@@ -175,6 +175,11 @@ void SpreadsheetWidget::load(const StringView& filename)
         GUI::MessageBox::show_error(window(), result.error());
         return;
     }
+
+    m_tab_widget->on_change = nullptr;
+    m_cell_value_editor->on_change = nullptr;
+    m_current_cell_label->set_text("");
+    m_should_change_selected_cells = false;
     while (auto* widget = m_tab_widget->active_widget()) {
         m_tab_widget->remove_tab(*widget);
     }