This commit is contained in:
David Rose 2009-07-10 00:17:30 +00:00
parent dc6c73108c
commit 33a94a3996
4 changed files with 12 additions and 13 deletions

View File

@ -1033,7 +1033,6 @@ pyobj_to_xml(PyObject *value) {
}
// Now that it's stored in the map, increment its reference count.
// TODO: implement removing things from this map.
Py_INCREF(value);
xvalue->SetAttribute("type", "python");

View File

@ -485,7 +485,6 @@ p3dobj_to_xml(P3D_object *obj) {
}
// Now that it's stored in the map, increment its reference count.
// TODO: implement removing things from this map.
P3D_OBJECT_INCREF(obj);
xvalue->SetAttribute("type", "browser");

View File

@ -124,21 +124,21 @@ P3D_instance_setup_window(P3D_instance *instance,
void
P3D_object_incref(P3D_object *object) {
assert(P3DInstanceManager::get_global_ptr()->is_initialized());
ACQUIRE_LOCK(_api_lock);
P3D_OBJECT_INCREF(object);
RELEASE_LOCK(_api_lock);
if (object != NULL) {
ACQUIRE_LOCK(_api_lock);
P3D_OBJECT_INCREF(object);
RELEASE_LOCK(_api_lock);
}
}
void
P3D_object_decref(P3D_object *object) {
assert(P3DInstanceManager::get_global_ptr()->is_initialized());
ACQUIRE_LOCK(_api_lock);
P3D_OBJECT_DECREF(object);
RELEASE_LOCK(_api_lock);
if (object != NULL) {
ACQUIRE_LOCK(_api_lock);
P3D_OBJECT_DECREF(object);
RELEASE_LOCK(_api_lock);
}
}
P3D_class_definition *

View File

@ -475,7 +475,8 @@ struct _P3D_object {
#define P3D_OBJECT_DECREF(object) { if (--(object)->_ref_count <= 0) { (object)->_class->_finish((object)); } }
#define P3D_OBJECT_XDECREF(object) { if ((object) != (P3D_object *)NULL) { P3D_OBJECT_DECREF(object); } }
/* Use these functions for thread-safe variants of the above. */
/* Use these functions for thread-safe variants of the above. You may
safely pass a NULL pointer into either; it will be ignored. */
typedef void
P3D_object_incref_func(P3D_object *object);
typedef void