#include "wx/filepicker.h"
+#include "wx/scopedptr.h"
+
// ============================================================================
// implementation
void wxGenericFileDirButton::OnButtonClick(wxCommandEvent& WXUNUSED(ev))
{
- wxDialog *p = CreateDialog();
+ wxScopedPtr<wxDialog> p(CreateDialog());
if (p->ShowModal() == wxID_OK)
{
// save updated path in m_path
- UpdatePathFromDialog(p);
+ UpdatePathFromDialog(p.get());
// fire an event
wxFileDirPickerEvent event(GetEventType(), this, GetId(), m_path);
GetEventHandler()->ProcessEvent(event);
}
-
- wxDELETE(p);
}
#endif // wxUSE_FILEPICKERCTRL || wxUSE_DIRPICKERCTRL