Skip to content
Snippets Groups Projects
Commit 904c0d66 authored by Nicolas Pope's avatar Nicolas Pope
Browse files

Fix for overlay memory overrun

parent 00fcc9dd
No related branches found
No related tags found
1 merge request!316Resolves #343 GUI and Frame Refactor
......@@ -112,7 +112,7 @@ AddSourceWindow::~AddSourceWindow() {
}
nanogui::Button *AddSourceWindow::_addButton(const std::string &s, nanogui::Widget *parent) {
nanogui::Button *AddSourceWindow::_addButton(const std::string &s, nanogui::Widget *parent, bool hide) {
using namespace nanogui;
ftl::URI uri(s);
......@@ -137,9 +137,9 @@ nanogui::Button *AddSourceWindow::_addButton(const std::string &s, nanogui::Widg
button->setFontSize(18);
button->setTooltip(s);
button->setCallback([this, uri = s]() {
button->setCallback([this, uri = s, hide]() {
ctrl_->add(uri);
close();
if (hide) close();
});
return button;
......@@ -205,7 +205,7 @@ void AddSourceWindow::rebuild() {
auto hostsrcs = ctrl_->getHosts();
for (auto &s : hostsrcs) {
_addButton(s, tab_items_[3]);
_addButton(s, tab_items_[3], false);
}
auto streamsrcs = ctrl_->getNetSources();
......
......@@ -25,7 +25,7 @@ private:
void close();
void rebuild();
nanogui::Button *_addButton(const std::string &s, nanogui::Widget *parent);
nanogui::Button *_addButton(const std::string &s, nanogui::Widget *parent, bool hide=true);
ftl::Handle new_source_handle_;
MUTEX mutex_;
......
......@@ -166,8 +166,8 @@ void Overlay::_createShapes() {
shapes_[Shape::XZPLANE] = {88, 2*3, 94, 40*2};
shapes_[Shape::AXIS] = {0, 0, 82, 2*3};
oShader.uploadAttrib("vertex", sizeof(float3)*shape_verts_.size(), 3, sizeof(float), GL_FLOAT, false, shape_verts_.data());
oShader.uploadAttrib ("indices", sizeof(int)*shape_tri_indices_.size(), 1, sizeof(int), GL_UNSIGNED_INT, true, shape_tri_indices_.data());
oShader.uploadAttrib("vertex", 3*shape_verts_.size(), 3, sizeof(float), GL_FLOAT, false, shape_verts_.data());
oShader.uploadAttrib ("indices", 1*shape_tri_indices_.size(), 1, sizeof(int), GL_UNSIGNED_INT, true, shape_tri_indices_.data());
}
void Overlay::_drawFilledShape(Shape shape, const Eigen::Matrix4d &pose, float scale, uchar4 c) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment