Code:
template <class T> class VertexLock
{
public:
// Locks object vertex data with specified lock mode.
VertexLock( T* obj, T::LockType lock ) :
m_obj(obj)
{
obj->lockVertices( lock );
}
// Unlocks object vertex data.
~VertexLock()
{
m_obj->unlockVertices();
}
private:
T* m_obj; // note! this must be weak pointer because otherwise all models must be allocated to heap
VertexLock();
VertexLock( const VertexLock& );
VertexLock& operator=( const VertexLock& );
};
heres a code snippet, where i have highlighted bold is where one of the problems is