diff --git a/include/GParted_Core.h b/include/GParted_Core.h index f96b0f96..538c4cf5 100644 --- a/include/GParted_Core.h +++ b/include/GParted_Core.h @@ -36,6 +36,7 @@ public: ~GParted_Core() ; void init_filesystems() ; + static void fini_filesystems(); void find_supported_filesystems() ; void set_user_devices( const std::vector & user_devices ) ; void set_devices( std::vector & devices ) ; diff --git a/src/GParted_Core.cc b/src/GParted_Core.cc index cf45fabf..8f8bbf64 100644 --- a/src/GParted_Core.cc +++ b/src/GParted_Core.cc @@ -128,6 +128,16 @@ void GParted_Core::init_filesystems() FILESYSTEM_MAP[ FS_LINUX_SWSUSPEND ] = NULL ; } +void GParted_Core::fini_filesystems() +{ + std::map::iterator fs_iter; + for ( fs_iter = FILESYSTEM_MAP.begin() ; fs_iter != FILESYSTEM_MAP.end() ; fs_iter ++ ) + { + delete fs_iter->second; + fs_iter->second = NULL; + } +} + void GParted_Core::find_supported_filesystems() { std::map< FILESYSTEM, FileSystem * >::iterator f ; @@ -4026,6 +4036,8 @@ PedExceptionOption GParted_Core::ped_exception_handler( PedException * e ) GParted_Core::~GParted_Core() { + // Delete file system map entries + fini_filesystems(); } Glib::Thread *GParted_Core::mainthread;