Repository navigation
Conversation
|
Seems like CI is having a hard time with this. But not because the tests are failing, but not finishing. |
|
So I think the tests are now passing. Unsure if it is because the various CI was having trouble in general, or if this change causes non-deterministic-ish lockups. |
|
AppVeyor still looks pretty unhappy! |
|
Ah. Looks like this branch needs to be rebased following the flake8 stuff, sorry! |
|
|
||
| cdef ContainerProxy proxy | ||
| cdef object __weakref__ | ||
| # cdef object __weakref__ |
|
Yeah... they all do. That was my biggest holdup. But I figure if I flake8 them first, it won't be too bad. |
| self.codec_context.stream_index = stream.index | ||
|
|
||
| def __dealloc__(self): | ||
| if self._codec_options: |
There was a problem hiding this comment.
Nice catch, it looks like this was not used at all!
| # Stream attributes. | ||
| cdef ContainerProxy _container | ||
| cdef _weak_container | ||
| cdef readonly Container container |
There was a problem hiding this comment.
I'm thinking we need some kind of mechanism to break the Container <-> Stream reference loop when the container gets closed, but this can probably be addressed in a separate PR
There was a problem hiding this comment.
I've been looking into overriding the tp_traverse and tp_clear so we can have cycles with __del__ and still deal with it. Not sure if that is something we can actually do, but...
There was a problem hiding this comment.
I think we could leave the ContainerProxy as a sort of ContainerPointer that only deals with the de-alloc, which would make the code a LOT simpler... if we removed Stream.seek.
(Of the top of my head at least).
Agreed. Let's get this PR merged next as some others will need refactoring afterwards. |
This was a layer that was once required for garbage collection due to the cyclic relationships between containers and streams. Newer Cythons seem to deal with it better.
|
Just pushed the rebase. That was a LOT easier than I thought it would be. I'm now quite happy we pulled the trigger on that flake8 stuff. |
This was a layer that was once required for garbage collection due to the
cyclic relationships between containers and streams. Newer Cythons seem to deal
with it better.