I hope I am not so stupid as someone can think.

If you compile "hello" example and add delete window
after Fl::run() you will get a crash under windows.
At least I got it.

My trivial example was:

main() {
  Fl_Window window(340,180);
}

~Fl_Window() gets called when variable goes out of scope.
It does not crash, but it exposes memory leaks.

Regards,
Mikhail





> >> I found that
> >>
> Fl_Window window(340,180);
>
> >>   int ret = Fl::run();
> >>   delete window;
> >>
> >> causing program to crash.
> >
> > That actually *IS* a known bug in MSWindows
>
> I think, it is more basic and regarding to local variables:
>
> void Crash()
> {
>       int A;
>       delete &A;
> }
>
> This will always crash when leaving Crash(), because A will be released
> twice. The only difference to example above is local scope inside of a
> function and not inside of main function.

_______________________________________________
fltk-dev mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk-dev

Reply via email to