From 9e787199a4abaf36f0c2b7b8f5d33af16048b7bf Mon Sep 17 00:00:00 2001 From: Odilitime <janesmith@airmail.cc> Date: Thu, 24 Aug 2017 01:15:02 -0700 Subject: [PATCH] fix includes, reset (release) document --- src/graphics/components/TabbedComponent.cpp | 5 +++++ src/graphics/components/TabbedComponent.h | 3 ++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/graphics/components/TabbedComponent.cpp b/src/graphics/components/TabbedComponent.cpp index de7c7d08..e84cdbe1 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 f5b54163..56c18ff4 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 -- GitLab