X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/1c66f293b6d7c7ef99cf8f8fc7b391d694e169f0..7948c0c24401c496c04da3c28f1f1f2f282ba327:/src/mac/dirmac.cpp diff --git a/src/mac/dirmac.cpp b/src/mac/dirmac.cpp index c1b010f5f7..0ccaf0b8e9 100644 --- a/src/mac/dirmac.cpp +++ b/src/mac/dirmac.cpp @@ -40,6 +40,8 @@ #include #endif +#include "wx/mac/private.h" + #include "MoreFiles.h" #include "MoreFilesExtras.h" @@ -116,7 +118,8 @@ wxDirData::wxDirData(const wxString& dirname) m_CPB.hFileInfo.ioNamePtr = m_name ; m_index = 0 ; - FSpGetDirectoryID( &fsspec , &m_dirId , &m_isDir ) ; + OSErr err = FSpGetDirectoryID( &fsspec , &m_dirId , &m_isDir ) ; + wxASSERT_MSG( err == noErr , "Error accessing directory") ; } wxDirData::~wxDirData() @@ -154,6 +157,11 @@ bool wxDirData::Read(wxString *filename) strcpy( (char *)m_name, c_name); #else p2cstr( m_name ) ; +#endif +#if TARGET_CARBON + // under X thats the way the mounting points look like + if ( ( m_CPB.dirInfo.ioDrDirID == 0 ) && ( m_flags & wxDIR_DIRS) ) + break ; #endif if ( ( m_CPB.dirInfo.ioFlAttrib & ioDirMask) != 0 && (m_flags & wxDIR_DIRS) ) // we have a directory break ; @@ -251,7 +259,10 @@ wxString wxDir::GetName() const wxDir::~wxDir() { - delete M_DIR; + if (M_DIR != NULL) { + delete M_DIR; + m_data = NULL; + } } // ----------------------------------------------------------------------------