Fix 1800126. Use a loose_handle instead of a handle to prevent the layer being free...
authordooglus <dooglus@1f10aa63-cdf2-0310-b900-c93c546f37ac>
Sat, 22 Sep 2007 17:37:38 +0000 (17:37 +0000)
committerdooglus <dooglus@1f10aa63-cdf2-0310-b900-c93c546f37ac>
Sat, 22 Sep 2007 17:37:38 +0000 (17:37 +0000)
git-svn-id: http://svn.voria.com/code@735 1f10aa63-cdf2-0310-b900-c93c546f37ac

synfig-core/trunk/src/synfig/canvas.cpp
synfig-core/trunk/src/synfig/canvas.h

index 035208d..b607345 100644 (file)
@@ -700,7 +700,7 @@ Canvas::insert(iterator iter,etl::handle<Layer> 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<Layer> 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> layer)
 }
 
 void
-Canvas::add_connection(etl::handle<Layer> 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> layer)
+Canvas::disconnect_connections(Layer::LooseHandle layer)
 {
        std::vector<sigc::connection>::iterator iter;
        for(iter=connections_[layer].begin();iter!=connections_[layer].end();++iter)
index 972b6cf..7f9d662 100644 (file)
@@ -143,7 +143,7 @@ private:
        std::map<String,std::set<etl::handle<Layer> > > group_db_;
 
        //! Layer Connection database
-       std::map<etl::handle<Layer>,std::vector<sigc::connection> > connections_;
+       std::map<etl::loose_handle<Layer>,std::vector<sigc::connection> > connections_;
 
        /*
  -- ** -- S I G N A L S -------------------------------------------------------
@@ -473,8 +473,8 @@ public:
 private:
        void add_group_pair(String group, etl::handle<Layer> layer);
        void remove_group_pair(String group, etl::handle<Layer> layer);
-       void add_connection(etl::handle<Layer> layer, sigc::connection connection);
-       void disconnect_connections(etl::handle<Layer> layer);
+       void add_connection(etl::loose_handle<Layer> layer, sigc::connection connection);
+       void disconnect_connections(etl::loose_handle<Layer> layer);
 
 protected:
        virtual void on_changed();