From acc4f339fcdc9147e0fc144dbaf53a298df9abee Mon Sep 17 00:00:00 2001 From: Jonathan <30329245+CookStar@users.noreply.github.com> Date: Tue, 1 Oct 2024 03:42:38 +0900 Subject: [PATCH 1/3] Removed unnecessary _BaseSound._unload_instance function --- addons/source-python/packages/source-python/engines/sound.py | 5 ----- 1 file changed, 5 deletions(-) diff --git a/addons/source-python/packages/source-python/engines/sound.py b/addons/source-python/packages/source-python/engines/sound.py index 00a955183..148e30566 100644 --- a/addons/source-python/packages/source-python/engines/sound.py +++ b/addons/source-python/packages/source-python/engines/sound.py @@ -285,11 +285,6 @@ def duration(self): self._duration = value return value - def _unload_instance(self): - """Remove the sample from the downloads list.""" - if self._downloads is not None: - self._downloads._unload_instance() - class Sound(_BaseSound): """Class used to interact with precached sounds. From e5e54ae5c6fb3ebcd4b5d8ab15dbe31746c45375 Mon Sep 17 00:00:00 2001 From: Jonathan <30329245+CookStar@users.noreply.github.com> Date: Tue, 1 Oct 2024 04:07:50 +0900 Subject: [PATCH 2/3] Deleted WeakAutoUnload. --- addons/source-python/packages/source-python/engines/sound.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/addons/source-python/packages/source-python/engines/sound.py b/addons/source-python/packages/source-python/engines/sound.py index 148e30566..12dac3d3f 100644 --- a/addons/source-python/packages/source-python/engines/sound.py +++ b/addons/source-python/packages/source-python/engines/sound.py @@ -21,8 +21,6 @@ from mutagen import oggvorbis # Source.Python Imports -# Core -from core import WeakAutoUnload # Engines from engines import engines_logger # Entities @@ -100,7 +98,7 @@ class Attenuation(float, Enum): # ============================================================================= # >> CLASSES # ============================================================================= -class _BaseSound(WeakAutoUnload): +class _BaseSound: """Base class for sound classes.""" # Set the base _downloads attribute to know whether From 3ab632c88df9b3dc5cb7de6964a8d880a8154d28 Mon Sep 17 00:00:00 2001 From: Jonathan <30329245+CookStar@users.noreply.github.com> Date: Wed, 18 Dec 2024 05:36:27 +0900 Subject: [PATCH 3/3] Changed _PrecacheBase also not to call self._downloads._unload_instance(). --- .../packages/source-python/engines/precache.py | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/addons/source-python/packages/source-python/engines/precache.py b/addons/source-python/packages/source-python/engines/precache.py index ce42bbdd4..8f7c634e3 100644 --- a/addons/source-python/packages/source-python/engines/precache.py +++ b/addons/source-python/packages/source-python/engines/precache.py @@ -113,13 +113,7 @@ def _server_spawn(self, game_event): self._precache() def _unload_instance(self): - """Remove from the downloads list and unregister server_spawn.""" - # Remove the path from the downloads list - try: - self._downloads._unload_instance() - except AttributeError: - pass - + """Unregister server_spawn.""" # Unregister the server_spawn event event_manager.unregister_for_event('server_spawn', self._server_spawn)