Skip to content

Commit 593a182

Browse files
disposed RGBA video frames to fix indefinite linear growth of memory (#146)
1 parent 0ebcf0d commit 593a182

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

Runtime/Scripts/VideoStream.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,14 +113,15 @@ public IEnumerator Update()
113113
}
114114
var rgba = VideoBuffer.ToRGBA();
115115
{
116-
Texture.LoadRawTextureData((IntPtr)rgba.Info.DataPtr, (int)rgba.GetMemorySize());
116+
Texture.LoadRawTextureData((IntPtr)rgba.Info.DataPtr, (int)rgba.GetMemorySize());
117117
}
118118
Texture.Apply();
119119

120120
if (textureChanged)
121121
TextureReceived?.Invoke(Texture);
122122

123123
TextureUploaded?.Invoke();
124+
rgba.Dispose();
124125
}
125126

126127
yield break;

0 commit comments

Comments
 (0)