I think I found the bug

"parshin.da" <[email protected]>
Newsgroups gmane.comp.lang.lua.bind.user
Message-ID <[email protected]>
I think I found the bug - there is no operator= in class "scope", 
operator= generated by compiler is inappropriate in this case. In my 
case I fixed it by the following patch:

--- a/luabind/luabind/scope.hpp
+++ b/luabind/luabind/scope.hpp
@@ -60,6 +60,8 @@ namespace luabind {
         scope(scope const& other_);
         ~scope();

+        scope& operator=( const scope& other_ );
+
         scope& operator,(scope s);

         void register_(lua_State* L) const;
diff --git a/luabind/src/scope.cpp b/luabind/src/scope.cpp
index 0050a91..c95f1a5 100755
--- a/luabind/src/scope.cpp
+++ b/luabind/src/scope.cpp
@@ -59,6 +59,14 @@ namespace luabind { namespace detail {
         const_cast<scope&>(other).m_chain = 0;
     }

+    scope& scope::operator=( const scope& other_ )
+    {
+        delete m_chain;
+        m_chain = other_.m_chain;
+        const_cast<scope&>(other_).m_chain = 0;
+        return *this;
+    }
+
     scope::~scope()
     {
         delete m_chain;


------------------------------------------------------------------------------
Sell apps to millions through the Intel(R) Atom(Tm) Developer Program
Be part of this innovative community and reach millions of netbook users 
worldwide. Take advantage of special opportunities to increase revenue and 
speed time-to-market. Join now, and jumpstart your future.
http://p.sf.net/sfu/intel-atom-d2d
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.