Hi,

I've had a look at the QPointer header class and don't see any overloaded delete function?

This is now my class :

Qt Code:
  1. template<class T> class DAPointer {
  2. T* m_pPtr;
  3. public:
  4. inline DAPointer( T* p=0 ) : m_pPtr(p){}
  5. inline ~DAPointer() { delete m_pPtr; m_pPtr = NULL; }
  6. inline void operator delete (void *p)
  7. { DAPointer<T>* pc = static_cast<DAPointer<T>*>(p); free(p); p = NULL; };
  8. };
To copy to clipboard, switch view to plain text mode 

So I thought now that the following would call the delete function above :

Qt Code:
  1. m_pView = new CanView();
  2. delete m_pView;
To copy to clipboard, switch view to plain text mode 

As m_pView is DAPointer<CanView>m_pCanView

Unfortunately, doesn't appear my delete function is being used as getting the usual cannot convertfrom DAPointer<T> to void* error...

Anybody see anything incorrect?

Regards,
Steve