From a663c348d362732f379e7e4a9b41dc581ebba726 Mon Sep 17 00:00:00 2001 From: David Rose Date: Tue, 7 Jul 2009 01:50:02 +0000 Subject: [PATCH] fix crash --- direct/src/plugin/p3dSession.cxx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/direct/src/plugin/p3dSession.cxx b/direct/src/plugin/p3dSession.cxx index 8af2df5de7..8b3e4b794c 100644 --- a/direct/src/plugin/p3dSession.cxx +++ b/direct/src/plugin/p3dSession.cxx @@ -426,8 +426,9 @@ p3dobj_to_xml(const P3D_object *obj) { // Otherwise, it must a host-provided object, which means we // should pass a reference down to this particular object, so // the Python process knows to call back up to here to query it. - // TODO: pass pointers better. - int object_id = (int)obj; + // TODO: pass pointers better. Fix this hideous leak. + P3D_object *dup = P3D_OBJECT_COPY(obj); + int object_id = (int)dup; xvalue->SetAttribute("type", "browser"); xvalue->SetAttribute("object_id", object_id);