Closed ipelupessy closed 4 years ago
This... can't be true. Right?
But, thinking about this some more, could it be that the channelmap gets deallocated at some point, which is the real cause of the error? Perhaps saving it to self._channelmap
instead of channelmap
could solve the issue (by keeping it alive as long as the stream is alive)? If that helps, the same should probably be true for samplespec
.
I suspect the reason why this worked might be that the python garbage collector and allocator reuse freed objects in some order related to when they were freed and what their addresses are.
Moving the allocation up a little might leave the contents of the freed objects alone a little longer, just long enough they do not get overwritten by the time the new stream has finished getting set up.
@rikvanriel is probably right. At any rate, his be44b6557d68147a5789f7174cf4880f2efe6901 should fix this issue properly.
yea, in retrospect.. such change in behaviour after only moving around stuff should trigger a suspicion of a GC issue!
But only in retrospect. This is the kind of bug that often requires inspiration by multiple people.
this change in the order of the code fixes or at least alleviates #63 for me
to be honest I don't understand why it makes a difference...