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

Fix for memory corruption in thumbnails

parent a5903dbf
No related branches found
No related tags found
1 merge request!316Resolves #343 GUI and Frame Refactor
Pipeline #28539 passed
......@@ -398,7 +398,7 @@ else()
add_definitions(-DUNIX)
# -fdiagnostics-color
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++17 -fPIC -msse3 -Wall -Werror=unused-result -Werror=return-type")
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -D_DEBUG -pg")
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -pg")
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -O3 -mfpmath=sse")
set(OS_LIBS "dl")
endif()
......
......@@ -107,6 +107,7 @@ nanogui::Vector2i Screen::viewSize() {
void Screen::showError(const std::string&title, const std::string& msg) {
// FIXME: This isn't thread safe?
if (msgerror_) { return; }
msgerror_ = new nanogui::MessageDialog
(screen(), nanogui::MessageDialog::Type::Warning, title, msg);
......
......@@ -133,8 +133,6 @@ Thumbnails::~Thumbnails() {
}
bool Thumbnails::mouseButtonEvent(const nanogui::Vector2i &p, int button, bool down, int modifiers) {
bool r = View::mouseButtonEvent(p, button, down, modifiers);
if (button == 1) {
if (!down) {
context_menu_->setPosition(p - mPos);
......@@ -144,6 +142,8 @@ bool Thumbnails::mouseButtonEvent(const nanogui::Vector2i &p, int button, bool d
} else {
context_menu_->setVisible(false);
}
bool r = View::mouseButtonEvent(p, button, down, modifiers);
return r;
}
......
......@@ -65,6 +65,6 @@ class exception : public std::exception
}
#define FTL_Error(A) (ftl::exception(ftl::Formatter() << __FILE__ << ":" << __LINE__ << ": " << A))
#define FTL_Error(A) (ftl::exception(ftl::Formatter() << A << " [" << __FILE__ << ":" << __LINE__ << "]"))
#endif // _FTL_EXCEPTION_HPP_
......@@ -260,6 +260,13 @@ void Universe::_cleanupPeers() {
auto ix = peer_ids_.find(p->id());
if (ix != peer_ids_.end()) peer_ids_.erase(ix);
for (auto i=peer_by_uri_.begin(); i != peer_by_uri_.end(); ++i) {
if (i->second == p) {
peer_by_uri_.erase(i);
break;
}
}
i = peers_.erase(i);
if (p->status() == ftl::net::Peer::kReconnecting) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment