diff --git a/reactos/base/shell/explorer/desktop/desktop.cpp b/reactos/base/shell/explorer/desktop/desktop.cpp index 8e65c9c0007..b31b8ebe595 100644 --- a/reactos/base/shell/explorer/desktop/desktop.cpp +++ b/reactos/base/shell/explorer/desktop/desktop.cpp @@ -837,11 +837,11 @@ void DesktopShellView::PositionIcons(int dir) // use a little trick to get the icons where we want them to be... - for(IconMap::const_iterator it=pos_idx.end(); --it!=pos_idx.begin(); ) { - const IconPos& pos = it->first; + //for(IconMap::const_iterator it=pos_idx.end(); --it!=pos_idx.begin(); ) { + // const IconPos& pos = it->first; - ListView_SetItemPosition32(_hwndListView, it->second, pos.second, pos.first); - } + // ListView_SetItemPosition32(_hwndListView, it->second, pos.second, pos.first); + //} for(IconMap::const_iterator it=pos_idx.begin(); it!=pos_idx.end(); ++it) { const IconPos& pos = it->first; diff --git a/reactos/base/shell/explorer/explorer.cpp b/reactos/base/shell/explorer/explorer.cpp index 566b79c27dc..d42246b0bed 100644 --- a/reactos/base/shell/explorer/explorer.cpp +++ b/reactos/base/shell/explorer/explorer.cpp @@ -227,6 +227,10 @@ LPCTSTR FileTypeManager::set_type(Entry* entry, bool dont_hide_ext) // hide some file extensions if (type._neverShowExt && !dont_hide_ext) { int len = ext - entry->_data.cFileName; + + if (entry->_display_name != entry->_data.cFileName) + free(entry->_display_name); + entry->_display_name = (LPTSTR) malloc((len+1)*sizeof(TCHAR)); lstrcpyn(entry->_display_name, entry->_data.cFileName, len + 1); } @@ -627,6 +631,26 @@ const Icon& IconCache::get_icon(int id) return _icons[id]; } +IconCache::~IconCache() +{ + for (int index = s_next_id; index >= 0; index--) + { + IconMap::iterator found = _icons.find(index); + + if (found != _icons.end()) + { + Icon& icon = found->second; + + if ((icon.get_icontype() == IT_DYNAMIC) || + (icon.get_icontype() == IT_CACHED)) + { + DestroyIcon(icon.get_hicon()); + _icons.erase(found); + } + } + } +} + void IconCache::free_icon(int icon_id) { IconMap::iterator found = _icons.find(icon_id); diff --git a/reactos/base/shell/explorer/globals.h b/reactos/base/shell/explorer/globals.h index 1848771c139..67c1dc48765 100644 --- a/reactos/base/shell/explorer/globals.h +++ b/reactos/base/shell/explorer/globals.h @@ -108,6 +108,7 @@ struct Icon { int get_sysiml_idx() const {return _itype==IT_SYSCACHE? _sys_idx: -1;} HICON get_hicon() const {return _itype!=IT_SYSCACHE? _hicon: 0;} + ICON_TYPE get_icontype() const { return _itype; } bool destroy() {if (_itype == IT_DYNAMIC) {DestroyIcon(_hicon); return true;} else return false;} @@ -126,6 +127,7 @@ struct SysCacheIcon : public Icon { struct IconCache { IconCache() : _himlSys_small(0) {} + virtual ~IconCache(); void init(); const Icon& extract(LPCTSTR path, ICONCACHE_FLAGS flags=ICF_NORMAL); diff --git a/reactos/base/shell/explorer/shell/entries.cpp b/reactos/base/shell/explorer/shell/entries.cpp index 3811bfaca22..f2f4ed3dff1 100644 --- a/reactos/base/shell/explorer/shell/entries.cpp +++ b/reactos/base/shell/explorer/shell/entries.cpp @@ -107,6 +107,9 @@ Entry::~Entry() if (_content) free(_content); + + if (_down) + delete _down; }