Skip to content

Commit 8c3bcb9

Browse files
authored
PR realsenseai#14185 from martindevans: Fixed Resource Leak In Point Cloud Example
2 parents a24c405 + 5076ca8 commit 8c3bcb9

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

wrappers/csharp/Documentation/cookbook.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -281,7 +281,8 @@ pipe.Start();
281281

282282
using (var frames = pipe.WaitForFrames())
283283
using (var depth = frames.DepthFrame)
284-
using (var points = pc.Process(depth).As<Points>())
284+
using (var pc_frame = pc.Process(depth))
285+
using (var points = pc_frame.As<Points>())
285286
{
286287
// CopyVertices is extensible, any of these will do:
287288
var vertices = new float[points.Count * 3];
@@ -423,4 +424,4 @@ using (var sensor = playback.Sensors[0])
423424
SpinWait.SpinUntil(() => playback.Status == PlaybackStatus.Stopped);
424425
Print();
425426
}
426-
```
427+
```

0 commit comments

Comments
 (0)