access violation with C API

Discussion in 'Python' started by cptnwillard@gmail.com, Sep 11, 2006.

  1. Guest

    Hello all,

    The following triggers an "access violation" error, why?

    pPyType = (PyTypeObject*)malloc(sizeof(PyTypeObject));
    memset(pPyType, 0, sizeof(PyTypeObject));
    pPyType->ob_refcnt = 1;
    pPyType->tp_name = "noname";
    pPyType->tp_basicsize = sizeof(MyObject);
    pPyType->tp_flags = Py_TPFLAGS_DEFAULT;
    pPyType->tp_doc = "nodoc";
    PyType_Ready(pPyType);

    Thanks.
    , Sep 11, 2006
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. news
    Replies:
    0
    Views:
    424
  2. F. Prefect
    Replies:
    5
    Views:
    1,040
    Steven Cheng[MSFT]
    Oct 10, 2004
  3. Doug Trammell

    JNI Access Violation in jvm.dll

    Doug Trammell, Mar 4, 2004, in forum: Java
    Replies:
    5
    Views:
    8,133
    Chris Uppal
    Mar 5, 2004
  4. Allen
    Replies:
    9
    Views:
    397
  5. Steven Reddie

    Catching access violation exceptions

    Steven Reddie, Sep 29, 2003, in forum: C++
    Replies:
    15
    Views:
    1,317
    Alexander Terekhov
    Sep 30, 2003
Loading...

Share This Page