This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: missing DECREF's in embedding example
Type: Stage:
Components: Documentation Versions: Python 2.2
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: nnorwitz Nosy List: nnorwitz, yoda_gh
Priority: normal Keywords:

Created on 2002-10-21 10:30 by yoda_gh, last changed 2022-04-10 16:05 by admin. This issue is now closed.

Messages (2)
msg12887 - (view) Author: Gernot Hillier (yoda_gh) Date: 2002-10-21 10:30
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... 
msg12888 - (view) Author: Neal Norwitz (nnorwitz) * (Python committer) Date: 2002-12-17 00:41
Logged In: YES 
user_id=33168

Thanks!  Checked in as Doc/ext/run-func.c 1.4
History
Date User Action Args
2022-04-10 16:05:46adminsetgithub: 37350
2002-10-21 10:30:57yoda_ghcreate