diff --git a/src/graphics/components/TabbedComponent.cpp b/src/graphics/components/TabbedComponent.cpp index de7c7d08a14d3465f6631aff57ad7ce6504b1fef..e84cdbe16314e0ab78fd9f32947a7681f20e68fd 100644 --- a/src/graphics/components/TabbedComponent.cpp +++ b/src/graphics/components/TabbedComponent.cpp @@ -1,4 +1,7 @@ #include "TabbedComponent.h" +#include "DocumentComponent.h" +#include "InputComponent.h" +#include "BoxComponent.h" #include <iostream> TabbedComponent::TabbedComponent(const float rawX, const float rawY, const float rawWidth, const float rawHeight, const int passedWindowWidth, const int passedWindowHeight) : MultiComponent(rawX, rawY, rawWidth, rawHeight, passedWindowWidth, passedWindowHeight) { @@ -557,6 +560,8 @@ void TabbedComponent::removeTab(size_t tabId) { this->selectTab(pSelectedTab); } } + it->get()->contents.reset(); // nuke document + //it->reset(); // free memory before losing track of it it = this->tabs.erase(it); it->get()->previousTab = *prev; // next tab, set it to our previous if (!this->tabs.size()) { diff --git a/src/graphics/components/TabbedComponent.h b/src/graphics/components/TabbedComponent.h index f5b5416354113365b87f6aa2de3830e8377194cb..56c18ff4155f1e1d49927f1f2e75f4a2a8efe86d 100644 --- a/src/graphics/components/TabbedComponent.h +++ b/src/graphics/components/TabbedComponent.h @@ -2,12 +2,13 @@ #define TABBEDCOMPONENT_H #include "MultiComponent.h" -#include "DocumentComponent.h" +#include "TextComponent.h" #include "../../BrowsingHistory.h" struct Tab { //std::string title; // I think these could be unique_ptrs + // have to be shared, because we want shortcut ptrs to them // would make cleaning up a tab nice std::shared_ptr<TextComponent> titleBox; // these could be BoxComponents