From 0987d8d71fcb49087ac84d7a27f9c15b42185653 Mon Sep 17 00:00:00 2001
From: Benny Baumann <BenBE@geshi.org>
Date: Sun, 31 Mar 2019 19:10:26 +0200
Subject: [PATCH] dbg: Remove enable_shared_from_this for a moment

---
 src/ui/display.hpp | 4 ++--
 src/ui/view.cpp    | 4 ++--
 src/ui/view.hpp    | 2 +-
 3 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/src/ui/display.hpp b/src/ui/display.hpp
index b18fd3a..3cf06dc 100644
--- a/src/ui/display.hpp
+++ b/src/ui/display.hpp
@@ -15,7 +15,7 @@ namespace rmrf::ui {
  * It implements some basic information handling and a registry for
  * views.
  */
-class display : public std::enable_shared_from_this<display> {
+class display { // : public std::enable_shared_from_this<display> {
 public:
     typedef display self_type;
     typedef std::shared_ptr<self_type> ptr_type;
@@ -34,7 +34,7 @@ public:
     decltype(auto) sync(F &&f, Args &&... args) {
         lock_type lock(m);
 
-        return std::forward<F>(f)(shared_from_this(), std::forward<Args>(args)...);
+        return std::forward<F>(f)(nullptr /*shared_from_this()*/, std::forward<Args>(args)...);
     }
 };
 
diff --git a/src/ui/view.cpp b/src/ui/view.cpp
index e4f1073..8128a30 100644
--- a/src/ui/view.cpp
+++ b/src/ui/view.cpp
@@ -7,7 +7,7 @@ namespace rmrf::ui {
 
 view::view(const std::shared_ptr<view> &parent) : parent_view{parent}, child_views{} {
     if (this->parent_view) {
-        this->parent_view->add_child(this->shared_from_this());
+//        this->parent_view->add_child(this->shared_from_this());
     }
 }
 
@@ -17,7 +17,7 @@ view::~view() {
 
     // Notify our parent about us being destructed
     if (this->parent_view) {
-        this->parent_view->remove_child(this->shared_from_this());
+//        this->parent_view->remove_child(this->shared_from_this());
     }
 }
 
diff --git a/src/ui/view.hpp b/src/ui/view.hpp
index ebb0e13..fff51eb 100644
--- a/src/ui/view.hpp
+++ b/src/ui/view.hpp
@@ -14,7 +14,7 @@ namespace rmrf::ui {
 /**
  * This abstract class implements a view page.
  */
-class view : public ui_context, public std::enable_shared_from_this<view> {
+class view : public ui_context { //, public std::enable_shared_from_this<view> {
 private:
     std::shared_ptr<view> parent_view;
     std::list<std::shared_ptr<view>> child_views;
-- 
GitLab