Loading

Paste #pus57coge

  1. Index: src/story_gui.cpp
  2. ===================================================================
  3. --- src/story_gui.cpp   (revision 27382)
  4. +++ src/story_gui.cpp   (working copy)
  5. @@ -684,13 +684,16 @@
  6.      */
  7.     virtual void OnInvalidateData(int data = 0, bool gui_scope = true)
  8.     {
  9. -       if (!gui_scope) return;
  10. -
  11.         /* If added/removed page, force rebuild. Sort order never change so just a
  12.          * re-sort is never needed.
  13.          */
  14.         if (data == -1) {
  15. +           /* Pointer in story_pages may have become invalid. Clear them immediately */
  16.             this->story_pages.ForceRebuild();
  17. +           this->story_pages.Clear();
  18. +
  19. +           if (!gui_scope) return;
  20. +
  21.             this->BuildStoryPageList();
  22.  
  23.             /* Was the last page removed? */
  24. @@ -713,6 +716,12 @@
  25.             this->SetWidgetDirty(WID_SB_SEL_PAGE);
  26.             this->UpdatePrevNextDisabledState();
  27.         } else if (data >= 0 && this->selected_page_id == data) {
  28. +           /* Pointer in story_page_elements may have become invalid. Clear them immediately */
  29. +           this->story_page_elements.ForceRebuild();
  30. +           this->story_page_elements.Clear();
  31. +
  32. +           if (!gui_scope) return;
  33. +
  34.             this->RefreshSelectedPage();
  35.         }
  36.     }
  37.  

Comments