title: Segfault when trying to call a Python function from C
body: <p>So, I want to call a Python callback function from C.</p>
  
  <p>At some point, the function is sent to C and packed into a tuple like this</p>
  
  <pre><code>PyObject *userData = Py_BuildValue("Oi",py_callback,some_number);
  </code></pre>
  
  <p>Somewhere in that area, I do <code>Py_INCREF(py_callback)</code>, too.<br>
  At some later time in the program, I want to call that function</p>
  
  <pre><code>PyObject *py_callback;
  int some_number;
  PyArg_ParseTuple((PyObject*)userData,"Oi",&amp;py_callback,&amp;some_number); // returns true
  PyObject *py_result = PyObject_CallFunctionObjArgs(py_callback,
                                                     /* ... */
                                                     NULL);
  </code></pre>
  
  <p>and that last call throws a segmentation fault. Do you have any idea, why it would do such a thing?</p>