[skip ci] Fix memory leak in MarkVideoWatchedTask
This commit is contained in:
1 parent
9f5efb0ba7
commit
8f8a8980df
6 files changed
+57
-30
No files matched your search
@@ -27,4 +27,12 @@ namespace Assert
|
||||
end if
|
||||
end function
|
||||
|
||||
function NodeHasField(node as dynamic, field as string, message = invalid as dynamic) as void
|
||||
if node = invalid
|
||||
throw "Assertion failed: Node is invalid. " + ToString(message)
|
||||
end if
|
||||
if not node.hasField(field)
|
||||
throw "Assertion failed: Node does not have field '" + field + "'. " + ToString(message)
|
||||
end if
|
||||
end function
|
||||
end namespace
|
||||
@@ -1,6 +1,12 @@
|
||||
import "AssertUtils.bs"
|
||||
|
||||
namespace MessagePortUtils
|
||||
|
||||
function ObserveFieldScopedExSafe(node as dynamic, field as string, port as dynamic) as void
|
||||
#if DEBUG
|
||||
Assert.IsValid(node, "Node is invalid")
|
||||
Assert.NodeHasField(node, field, `Node does not have field "${field}"`)
|
||||
#end if
|
||||
' ObserveFieldScopedEx was added in 12.0
|
||||
if FindMemberFunction(node, "ObserveFieldScopedEx") <> invalid
|
||||
' bs:disable-next-line NO_OBSERVE_FIELD_SCOPED_EX
|
||||
|
||||
Reference in new issue
Block a user