Skip to content

Commit 0bb5495

Browse files
authored
Move .as_ptr() so its return doesn't dangle (#163)
1 parent d830925 commit 0bb5495

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

raylib/src/core/drawing.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1677,9 +1677,8 @@ pub trait RaylibDraw3D {
16771677
let tr = transforms
16781678
.iter()
16791679
.map(|f| f.into())
1680-
.collect::<Vec<ffi::Matrix>>()
1681-
.as_ptr();
1682-
unsafe { ffi::DrawMeshInstanced(*mesh.as_ref(), material.0, tr, transforms.len() as i32) }
1680+
.collect::<Vec<ffi::Matrix>>();
1681+
unsafe { ffi::DrawMeshInstanced(*mesh.as_ref(), material.0, tr.as_ptr(), transforms.len() as i32) }
16831682
}
16841683

16851684
/// Draws a sphere.

0 commit comments

Comments
 (0)