Skip to content

Commit fa82f7f

Browse files
committed
MixedRB: Free clips via vs_object
1 parent ebb9fc8 commit fa82f7f

1 file changed

Lines changed: 13 additions & 2 deletions

File tree

vodesfunc/rescale_ext/mixed_rescale.py

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
from vstools import vs, core, depth
1+
from vstools import vs, core, depth, vs_object
2+
from typing import TYPE_CHECKING, MutableMapping
23
from enum import IntEnum
34
from .base import RescaleBase
45

@@ -44,7 +45,7 @@ def _add_index_to_clips(self):
4445
self.upscaled = self.upscaled.std.SetFrameProp("RB_Target", self.index)
4546

4647

47-
class MixedRB:
48+
class MixedRB(vs_object):
4849
"""
4950
Implementation of MixedRescale for RescaleBuilder(s)
5051
@@ -128,3 +129,13 @@ def _selector(clips: list[vs.VideoNode | None]) -> vs.VideoNode:
128129

129130
def get_upscaled(self, *_) -> vs.VideoNode:
130131
return self.upscaled
132+
133+
def __vs_del__(self, core_id: int) -> None:
134+
if not TYPE_CHECKING:
135+
for v in self.__dict__.values():
136+
if not isinstance(v, MutableMapping):
137+
continue
138+
139+
for k2, v2 in v.items():
140+
if isinstance(v2, vs.VideoNode):
141+
v[k2] = None

0 commit comments

Comments
 (0)