Skip to content

Removed unnecessary _BaseSound._unload_instance function. #496

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -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)

9 changes: 1 addition & 8 deletions addons/source-python/packages/source-python/engines/sound.py
Original file line number Diff line number Diff line change
@@ -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
@@ -285,11 +283,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.