Thanks again... I've followed your suggestions and learned something, but not solved the problem.

If I use the original code (above) and simply remove the $MW->destroy() call from abort_routine, the segmentation fault disappears. Each time I click the button, the abort_routine gets called again, but of course without the $MW->destroy, the box never closes and the programme never exits.

When I modify the abort_routine code to include the counter you suggested and test for non-zero at the outset, the segmentation fault still happens as soon as I try and destroy the box. Also, if I replace abort_routine with a do_close which contains only the $MW->destroy, I also get the segmentation fault.

I've also tried using an alternate handle for the second box ($MW2), but I still get the segfault.

It seems that its the second call to $MW->destroy that's doing the damage. Is there something I need to do to clean-up after the first call???

Thanks,
Stefan


In reply to Re^4: Getting segfaults when destroying and recreating Tk box by skt
in thread Getting segfaults when destroying and recreating Tk box by skt

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.