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

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


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/ return $dom; >> $$xpc = XML::LibXML::XPathContext->new($dom); >> print "XML imported\n"; XML imported >> C:/Strawberry/perl/site/lib/ DoOneEvent(0); >> C:/Strawberry/perl/site/lib/ DoOneEvent(0); Free to wrong pool 31a960 not 2020202020200a at C:/Strawberry/perl/sit +e/lib/ line 424.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://11104076]
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
Find Nodes?
    Voting Booth?

    No recent polls found