For Programmers: Free Programming Magazines  


Home > Archive > PerlTk > January 2005 > Tk::TableMatrix and clipboard









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Tk::TableMatrix and clipboard
Davide

2005-01-26, 8:57 am

Hi all,

i'm having a few problems with Tk::TableMatrix on Win32 (activestate
perl).
If i select anything, pressing ctrl-c causes the script to crash with
a:

Free to wrong pool 1660200 not 1660250 at
C:/Perl/site/lib/Tk/TableMatrix.pm line 375.

That line simply states:
eval{ $txt = $w->SelectionGet( -selection => $sel) };

This happens even with the demos included with Tk::TableMatrix, and i
tried it on both win98 and winxp, with same results.

any hints?

thanks,
davide
John Cerney

2005-01-26, 3:57 pm

Verified on Windows 2000. Perl 5.8.4 (activestate)

After running this thru a debugger, It appears that the problem is due
to an extra Tcl_Free in the TableFetchSelection function in file
tkTable.c. (line 3550).

The Tcl_Free attempts to free a pointer supplied to
Tcl_ListObjGetElement. This free doesn't appear to be necessary. Any
other usages of Tcl_ListObjGetElement I can find in the Tk source don't
do any freeing after calling Tcl_ListObjGetElement.

This has been in TableMatrix (and Jeff Hobbs original tkTable, where
TableMatrix was ported from) for a long time. Not sure why the problem
hasn't shown up until now. Possibly due to the different ways the memory
allocation and free routines work between tcl, perl 5.6 and perl5.8?

I am going to do some further testing, and if everything checks out,
I'll put an updated TableMatrix out on CPAN.



Davide wrote:
> Hi all,
>
> i'm having a few problems with Tk::TableMatrix on Win32 (activestate
> perl).
> If i select anything, pressing ctrl-c causes the script to crash with
> a:
>
> Free to wrong pool 1660200 not 1660250 at
> C:/Perl/site/lib/Tk/TableMatrix.pm line 375.
>
> That line simply states:
> eval{ $txt = $w->SelectionGet( -selection => $sel) };
>
> This happens even with the demos included with Tk::TableMatrix, and i
> tried it on both win98 and winxp, with same results.
>
> any hints?
>
> thanks,
> davide

zorg.borg@gmail.com

2005-01-27, 8:56 am

Thanks a lot.
This was obviously way beyond my debugging skills...


Davide

Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com