From be5bee81c4116388f6f3626b6ce1089845c4f792 Mon Sep 17 00:00:00 2001 From: Steven Koo Date: Mon, 10 Aug 2020 17:36:45 -0500 Subject: rfnoc: Resolves streamer/link segfaults on python This commit resolves a segfault that occurs during teardown. Since teardown isn't detereministic in python, there were cases where the graph would destruct before the streamers or links got chance to cleanup. This would result in a segfault. This change gives the lambda a shared pointer to the object the callback method is calling on, so that it won't destruct before being called. --- host/include/uhd/rfnoc_graph.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'host/include') diff --git a/host/include/uhd/rfnoc_graph.hpp b/host/include/uhd/rfnoc_graph.hpp index fabee53c7..e51fc3d83 100644 --- a/host/include/uhd/rfnoc_graph.hpp +++ b/host/include/uhd/rfnoc_graph.hpp @@ -29,7 +29,7 @@ class mb_controller; * session, but also manages the RFNoC blocks on those devices. Only devices * compatible with a modern version of RFNoC can be addressed by this class. */ -class UHD_API rfnoc_graph : public uhd::noncopyable +class UHD_API rfnoc_graph : public uhd::noncopyable, public std::enable_shared_from_this { public: /*! A shared pointer to allow easy access to this class and for -- cgit v1.2.3