+bool wxVariant::Unshare()
+{
+ if ( m_data && m_data->GetRefCount() > 1 )
+ {
+ // note that ref is not going to be destroyed in this case...
+ const wxVariantData* ref = m_data;
+ UnRef();
+
+ // ... so we can still access it
+ m_data = ref->Clone();
+
+ wxASSERT_MSG( (m_data && m_data->GetRefCount() == 1),
+ _T("wxVariant::AllocExclusive() failed.") );
+
+ if (!m_data || m_data->GetRefCount() != 1)
+ return false;
+ else
+ return true;
+ }
+ //else: data is null or ref count is 1, so we are exclusive owners of m_refData anyhow
+ else
+ return true;
+}
+