Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Re^3: Script using Tk and LibXML crashing (Devel::Trace)

by Anonymous Monk
on Aug 07, 2019 at 04:25 UTC ( #11104076=note: print w/replies, xml ) Need Help??


in reply to Re^2: Script using Tk and LibXML crashing (Devel::Trace)
in thread Script using Tk and LibXML crashing

hmm,

I'd say kick that up to rt://Tk

Does it happen if you avoid getOpenFile? Like so

#!/usr/bin/perl -- use strict; use warnings; use XML::LibXML; use Tk; my $xpc; my $mw = MainWindow->new( -title => 'GUI' ); $mw->Button( -text => 'Load XML', -command => [ \&tk_Load_Export , \$xpc ], )->grid(-column => '0', -row => '0', -sticky => 'e'); MainLoop; sub tk_Load_Export { my( $ref_xpc ) = @_; #~ my $filename = $mw->getOpenFile( -title => 'Load XML', -default +extension => '.xml', -initialdir => '.' ) or return; my $filename = 'C:\bigbigxml.xml'; import_XML( $filename , $ref_xpc ); } sub import_XML { my( $filename , $ref_xpc ) = @_; print "Reading the XML file $filename\n\n"; undef $$xpc; # free previous $dom my $dom = XML::LibXML->load_xml(location => $filename, huge => 1); $$xpc = XML::LibXML::XPathContext->new($dom); print "XML imported\n"; }

Replies are listed 'Best First'.
Re^4: Script using Tk and LibXML crashing (Devel::Trace)
by misczol (Initiate) on Aug 07, 2019 at 10:34 UTC
    Yes, the same thing happens. I'm getting the same error.
    >> C:/Strawberry/perl/site/lib/XML/LibXML.pm:790: return $dom; >> test2.pl:27: $$xpc = XML::LibXML::XPathContext->new($dom); >> test2.pl:28: print "XML imported\n"; XML imported >> C:/Strawberry/perl/site/lib/Tk.pm:424: DoOneEvent(0); >> C:/Strawberry/perl/site/lib/Tk.pm:424: DoOneEvent(0); Free to wrong pool 31a960 not 2020202020200a at C:/Strawberry/perl/sit +e/lib/Tk.pm line 424.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://11104076]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (9)
As of 2019-12-13 23:58 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?