Menu

Py Created Object -> C++ Usage

Help
2009-08-07
2013-04-06
  • Dallin Wellington

    Im having problems getting an object created in python (through a Decorator class) to work C++ side. The class is essentially a container for my dispatcher that has a pointer to a python function.

    Im faily sure its not the class itself that is causing the crash, as it crashes when it tried to call a function from the class (NULL pointer).

    The class inheirts a base DispachCallback class, but Im sure I added everything to make upcasting work correct:

    ------------------------------------------------------------
        PythonQt::self()->registerCPPClass("pyNetworkDispatchCallback", NULL, NULL, PythonQtCreateObject<pyNetworkDispatchCallbackWrapper>);
        PythonQt::self()->addParentClass("pyNetworkDispatchCallback", "IDispatchCallback", PythonQtUpcastingOffset<pyNetworkDispatchCallback, IDispatchCallback>());
    ----------------------------------------------------------

    However, I persist to get access violation like im reading a NULL pointer. The dispatcher itself works 100%, as im using it to process the base of my networking protocol. I just need to script the processing of the higher-level messages in my protocol through scripts.

    Any ideas of what could be going wrong?

     
    • Dallin Wellington

      Its almost like its deleting the object python side before I can call it C++ when I need to dispatch a network event.

      It works perfectly fine when I call it in the decorator function that binds it to a key. I never had a problem with this in your v1.0, did you add some type of new Garbage Collection?

       

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.