Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Tcl_CreateEventSource( &tcl_dispatch_qt, 0, 0 ) help

38 views
Skip to first unread message

Alex (Oleksandr) Malyushytskyy

unread,
Jun 17, 2021, 12:29:32 AM6/17/21
to
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

Conor Williams

unread,
Oct 14, 2021, 5:36:53 PM10/14/21
to
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))
0 new messages