X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/76a5e5d21ee1a6230d777ce0209b2df4c6075f0f..80c82e01758cd838aa5c922b848454277b11da26:/src/mac/dirmac.cpp?ds=sidebyside diff --git a/src/mac/dirmac.cpp b/src/mac/dirmac.cpp index 1acff5b7ca..0ccaf0b8e9 100644 --- a/src/mac/dirmac.cpp +++ b/src/mac/dirmac.cpp @@ -118,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() @@ -156,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 ; @@ -253,7 +259,10 @@ wxString wxDir::GetName() const wxDir::~wxDir() { - delete M_DIR; + if (M_DIR != NULL) { + delete M_DIR; + m_data = NULL; + } } // ----------------------------------------------------------------------------