//---------------------------------------------------------------------------
// $Id$
-// Version: $Name$
//
-// Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2009 by the deal.II authors
+// Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2009, 2010 by the deal.II authors
//
// This file is subject to QPL and may not be distributed
// without copyright and license information. Please refer
*/
SmartPointer<T,P> & operator= (const SmartPointer<T,P> &tt);
+ /**
+ * Delete the object pointed to
+ * and set the pointer to zero.
+ */
+ void clear ();
+
/**
* Conversion to normal pointer.
*/
+template <typename T, typename P>
+inline
+void
+SmartPointer<T,P>::clear ()
+{
+ if (t != 0)
+ {
+ t->unsubscribe(id);
+ delete t;
+ t = 0;
+ }
+}
+
+
+
template <typename T, typename P>
inline
SmartPointer<T,P> & SmartPointer<T,P>::operator = (T *tt)