[Python-bugs-list] [ python-Bugs-626275 ] missing DECREF's in embedding example

noreply@sourceforge.net noreply@sourceforge.net
Mon, 16 Dec 2002 16:55:30 -0800


Bugs item #626275, was opened at 2002-10-21 06:30
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=626275&group_id=5470

Category: Documentation
Group: Python 2.2.1
Status: Closed
>Resolution: Fixed
Priority: 5
Submitted By: Gernot Hillier (yoda_gh)
Assigned to: Neal Norwitz (nnorwitz)
Summary: missing DECREF's in embedding example

Initial Comment:
Extending and Embedding Python, chapter 5.3 Pure Embedding 
 
There's a large example. 
 
I think there are some Py_DECREF's missing in the error handling 
cases: 
 
else { 
	PyErr_Print(); 
	fprintf(stderr, "Call failed\n"); 
	return 1; 
} 
 
--> this one misses IMHO 
Py_DECREF(pArgs); 
Py_DECREF(pModule); 
Py_DECREF(pName); 
 
else { 
	PyErr_Print(); 
	fprintf(stderr, "Failed to load \%s\\n", argv[1]); 
	return 1; 
} 
 
--> this one misses IMHO 
Py_DECREF(pName); 
 
I'm no Python expert, so I may be wrong - please check! 
 
If they're not necessary in these cases, you should perhaps add a 
comment explaining the reason to the docs... 

----------------------------------------------------------------------

Comment By: Neal Norwitz (nnorwitz)
Date: 2002-12-16 19:41

Message:
Logged In: YES 
user_id=33168

Thanks!  Checked in as Doc/ext/run-func.c 1.4

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=626275&group_id=5470