Skip to content

Commit

Permalink
fix assignment operator of SGVector and its clone method
Browse files Browse the repository at this point in the history
  • Loading branch information
Soeren Sonnenburg committed May 4, 2012
1 parent f46645d commit 4aafbd1
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions src/shogun/lib/SGVector.h
Expand Up @@ -55,6 +55,7 @@ template<class T> class SGVector
/** override assignment operator to increase refcount on assignments */
SGVector& operator= (const SGVector &orig)
{
unref();
vector=orig.vector;
vlen=orig.vlen;
m_refcount=orig.m_refcount;
Expand Down Expand Up @@ -166,12 +167,7 @@ template<class T> class SGVector
/** clone vector */
SGVector<T> clone()
{
SGVector<T> c;
c.vector=clone_vector(vector, vlen);
c.vlen=vlen;
//c.do_free=true;

return c;
return SGVector<T>(clone_vector(vector, vlen), vlen);
}

/** clone vector */
Expand Down

0 comments on commit 4aafbd1

Please sign in to comment.