def method_free_handle(self): if self.bass_handle: channel_info = self.method_get_channel_info() if channel_info.ctype >= pybass.BASS_CTYPE_MUSIC_MOD: if not pybass.BASS_MusicFree(self.bass_handle): print 'BASS_MusicFree error', pybass.get_error_description(pybass.BASS_ErrorGetCode()) else: self.bass_handle = 0 elif channel_info.ctype >= pybass.BASS_CTYPE_STREAM: if not pybass.BASS_StreamFree(self.bass_handle): print 'BASS_StreamFree error', pybass.get_error_description(pybass.BASS_ErrorGetCode()) else: self.bass_handle = 0
def freemusic(handle): """ Free MOD music handle from memory """ return dll.BASS_MusicFree(handle)