File: python_init_once.patch

package info (click to toggle)
newt 0.52.25-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 2,196 kB
  • sloc: ansic: 9,336; python: 713; makefile: 276; sh: 37; xml: 7
file content (25 lines) | stat: -rw-r--r-- 674 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
Description: newtInit() should only be called once
 Last-Updated: 2014-06-11
Bug-Debian: https://bugs.debian.org/557960
Forwarded: no
Author: Alastair McKinstry <mckinstry@debian.org>
Index: newt-0.52.24/snack.c
===================================================================
--- newt-0.52.24.orig/snack.c
+++ newt-0.52.24/snack.c
@@ -377,10 +377,15 @@ static snackWidget * snackWidgetNew (voi
 }
 
 static PyObject * initScreen(PyObject * s, PyObject * args) {
+    static int init_newt = 1;
     suspend.cb = NULL;
     suspend.data = NULL;
     
     newtInit();
+    if (init_newt) { 
+	newtInit();
+	init_newt = 0;
+    }
     newtCls();
 
     Py_INCREF(Py_None);