\constfunc{T*}{operator->}{\void}
-Gets a pointer to the reference counted object to which
-this class points. Same as \helpref{get}{wxobjectdataptrget}.
+Returns a pointer to the reference counted object to which
+this class points. If this the internal pointer is NULL,
+this method will assert in debug mode.
\membersection{wxObjectDataPtr<T>::operator=}\label{wxobjectdataptroperatorassign}
}
T *get() const { return m_ptr; }
- T *operator->() const { return get(); }
+
+ T *operator->() const
+ {
+ wxASSERT(m_ptr != NULL);
+ return get();
+ }
void reset(T *ptr)
{
if (m_ptr)
m_ptr->DecRef();
m_ptr = ptr;
- if (m_ptr)
- m_ptr->IncRef();
return *this;
}
wxT("German Requiem"), wxT("Johannes Brahms"), 1868 ) );
m_classicalMusicIsKnownToControl = false;
}
+
+ ~MyMusicModel()
+ {
+ delete m_root;
+ }
// helper method for wxLog
{
public:
MyFrame(wxFrame *frame, const wxString &title, int x, int y, int w, int h);
+ ~MyFrame();
public:
void OnQuit(wxCommandEvent& event);
child = treectrl2->AppendItem( parent,wxT("Child 1"), 0 );
child = treectrl2->AppendItem( parent,wxT("Child 2"), 0 );
child = treectrl2->AppendItem( parent,wxT("Child 3"), 0 );
-
+
bottom_sizer->Add( treectrl2 );
// main sizer
SetSizer( main_sizer );
}
+MyFrame::~MyFrame()
+{
+ delete wxLog::SetActiveTarget(m_logOld);
+}
+
void MyFrame::OnQuit(wxCommandEvent& WXUNUSED(event) )
{
Close(true);