From: dooglus Date: Sat, 22 Sep 2007 17:37:38 +0000 (+0000) Subject: Fix 1800126. Use a loose_handle instead of a handle to prevent the layer being free... X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=9917f387c36f82a079e817e14a8052b8e21cdf96;p=synfig.git Fix 1800126. Use a loose_handle instead of a handle to prevent the layer being free()d too early. git-svn-id: http://svn.voria.com/code@735 1f10aa63-cdf2-0310-b900-c93c546f37ac --- diff --git a/synfig-core/trunk/src/synfig/canvas.cpp b/synfig-core/trunk/src/synfig/canvas.cpp index 035208d..b607345 100644 --- a/synfig-core/trunk/src/synfig/canvas.cpp +++ b/synfig-core/trunk/src/synfig/canvas.cpp @@ -700,7 +700,7 @@ Canvas::insert(iterator iter,etl::handle x) //while(correct_canvas->is_inline())correct_canvas=correct_canvas->parent(); Layer::LooseHandle loose_layer(x); - add_connection(x, + add_connection(loose_layer, sigc::connection::connection( x->signal_added_to_group().connect( sigc::bind( @@ -708,7 +708,7 @@ Canvas::insert(iterator iter,etl::handle x) *correct_canvas, &Canvas::add_group_pair), loose_layer)))); - add_connection(x, + add_connection(loose_layer, sigc::connection::connection( x->signal_removed_from_group().connect( sigc::bind( @@ -1179,13 +1179,13 @@ Canvas::remove_group_pair(String group, etl::handle layer) } void -Canvas::add_connection(etl::handle layer, sigc::connection connection) +Canvas::add_connection(Layer::LooseHandle layer, sigc::connection connection) { connections_[layer].push_back(connection); } void -Canvas::disconnect_connections(etl::handle layer) +Canvas::disconnect_connections(Layer::LooseHandle layer) { std::vector::iterator iter; for(iter=connections_[layer].begin();iter!=connections_[layer].end();++iter) diff --git a/synfig-core/trunk/src/synfig/canvas.h b/synfig-core/trunk/src/synfig/canvas.h index 972b6cf..7f9d662 100644 --- a/synfig-core/trunk/src/synfig/canvas.h +++ b/synfig-core/trunk/src/synfig/canvas.h @@ -143,7 +143,7 @@ private: std::map > > group_db_; //! Layer Connection database - std::map,std::vector > connections_; + std::map,std::vector > connections_; /* -- ** -- S I G N A L S ------------------------------------------------------- @@ -473,8 +473,8 @@ public: private: void add_group_pair(String group, etl::handle layer); void remove_group_pair(String group, etl::handle layer); - void add_connection(etl::handle layer, sigc::connection connection); - void disconnect_connections(etl::handle layer); + void add_connection(etl::loose_handle layer, sigc::connection connection); + void disconnect_connections(etl::loose_handle layer); protected: virtual void on_changed();