Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit c6aa9e9

Browse files
committed
Some extra DECREFs.
1 parent 840bcf1 commit c6aa9e9

1 file changed

Lines changed: 9 additions & 3 deletions

File tree

Python/pythonmain.c

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,8 @@ main(argc, argv)
4444
}
4545

4646
/* XXX what is the ideal initialization order? */
47+
/* XXX exceptions are initialized by initrun but this
48+
may be too late */
4749

4850
initsys(argc-1, argv+1);
4951
inittime();
@@ -58,11 +60,15 @@ main(argc, argv)
5860
ret = runfile(fp, file_input, (char *)NULL, (char *)NULL);
5961
}
6062
else {
61-
sysset("ps1", newstringobject(">>> "));
62-
sysset("ps2", newstringobject("... "));
63+
object *v, *w;
64+
sysset("ps1", v = newstringobject(">>> "));
65+
sysset("ps2", w = newstringobject("... "));
66+
DECREF(v);
67+
DECREF(w);
6368
for (;;) {
64-
object *v = sysget("ps1"), *w = sysget("ps2");
6569
char *ps1 = NULL, *ps2 = NULL;
70+
v = sysget("ps1");
71+
w = sysget("ps2");
6672
if (v != NULL && is_stringobject(v)) {
6773
INCREF(v);
6874
ps1 = getstringvalue(v);

0 commit comments

Comments
 (0)