diff --git a/include/wx/dataobj.h b/include/wx/dataobj.h index 7c7aee91f9..923f297094 100644 --- a/include/wx/dataobj.h +++ b/include/wx/dataobj.h @@ -254,7 +254,7 @@ class WXDLLEXPORT wxDataObjectComposite : public wxDataObject { public: // ctor - wxDataObjectComposite() { m_preferred = 0; } + wxDataObjectComposite(); // add data object (it will be deleted by wxDataObjectComposite, hence it // must be allocated on the heap) whose format will become the preferred diff --git a/src/common/dobjcmn.cpp b/src/common/dobjcmn.cpp index d2d6a4e5b7..661b8114dc 100644 --- a/src/common/dobjcmn.cpp +++ b/src/common/dobjcmn.cpp @@ -94,6 +94,13 @@ bool wxDataObjectBase::IsSupported(const wxDataFormat& format, // wxDataObjectComposite // ---------------------------------------------------------------------------- +wxDataObjectComposite::wxDataObjectComposite() +{ + m_preferred = 0; + + m_dataObjects.DeleteContents(TRUE); +} + wxDataObjectSimple * wxDataObjectComposite::GetObject(const wxDataFormat& format) const {