[vlc-devel] [PATCH 7/7] medialib: fs: Ensure SD are destroyed first

Hugo Beauzée-Luyssen hugo at beauzee.fr
Thu Dec 12 15:10:56 CET 2019


Otherwise a callback during deletion could end up using already
destroyed member variables
Fix #23085
---
 modules/misc/medialibrary/fs/fs.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/modules/misc/medialibrary/fs/fs.h b/modules/misc/medialibrary/fs/fs.h
index 04c2e9e99f..d56853f457 100644
--- a/modules/misc/medialibrary/fs/fs.h
+++ b/modules/misc/medialibrary/fs/fs.h
@@ -90,13 +90,13 @@ public:
 private:
     vlc_object_t *const m_parent;
     const std::string m_scheme;
-    using SdPtr = std::unique_ptr<services_discovery_t, decltype(&vlc_sd_Destroy)>;
-    std::vector<SdPtr> m_sds;
     IFileSystemFactoryCb *m_callbacks;
 
     vlc::threads::mutex m_mutex;
     vlc::threads::condition_variable m_itemAddedCond;
     std::vector<std::shared_ptr<IDevice>> m_devices;
+    using SdPtr = std::unique_ptr<services_discovery_t, decltype(&vlc_sd_Destroy)>;
+    std::vector<SdPtr> m_sds;
 };
 
   } /* namespace medialibrary */
-- 
2.20.1



More information about the vlc-devel mailing list