• Re: Tcl_CreateEventSource( &tcl_dispatch_qt, 0, 0 ) help

    From Conor Williams@21:1/5 to al...@flex-logix.com on Thu Oct 14 14:36:51 2021
    i am just finished a contract and would love to do some of this coding..
    but... I need a piece of code from you that fully compiles with these flags: gcc blahblah.c -I/usr/include/tcl8.6/ -I/usr/include/tk8.6 -ltk8.6 -ltcl8.6 -o blahblah
    otherwise it may take too long to find the bug...
    but usually if something is NULL, then nothing has been allocated to it or a garbage collector may have run....
    I have gdb here ready to hook into your source code and i can step through line by
    line, the machine code binary...

    thanks in advance
    /d:2021141022:00))



    On Thursday, June 17, 2021 at 4:29:32 AM UTC, al...@flex-logix.com wrote:
    I am trying to migrate Tq library (Qt 4.15 and current release of tcl) (Thanks to Harri Porten and Frologic that they provided the source code)
    But I stuck with the problem,

    Call to Tcl_CreateEventSource crushes due to null pointer , which looking at the source is related to ThreadSpecificData *tsdPtr initialization

    void
    Tcl_CreateEventSource(
    Tcl_EventSetupProc *setupProc,
    /* Function to invoke to figure out what to
    * wait for. */
    Tcl_EventCheckProc *checkProc,
    /* Function to call after waiting to see what
    * happened. */
    ClientData clientData) /* One-word argument to pass to setupProc and
    * checkProc. */
    {
    ThreadSpecificData *tsdPtr = TCL_TSD_INIT(&dataKey);
    EventSource *sourcePtr = ckalloc(sizeof(EventSource));

    sourcePtr->setupProc = setupProc;
    sourcePtr->checkProc = checkProc;
    sourcePtr->clientData = clientData;
    sourcePtr->nextPtr = tsdPtr->firstEventSourcePtr; tsdPtr->firstEventSourcePtr = sourcePtr;
    }

    Could anybody point what should I do to fix the problem?

    Best regards,
    Alex

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)