Allegro.cc - Online Community

Allegro.cc Forums » Allegro Development » Taskbar entry on exit?

This thread is locked; no one can reply to it. rss feed Print
Taskbar entry on exit?
Richard Phipps
Member #1,632
November 2001
avatar

Hiya,

I've seen this issue very rarely on my machine, but is much more reproducable on other machines. Basically on exit, sometimes there is still a program entry on the taskbar which can't be killed apart from by using the task-manager. All logging seems to suggest a clean exit on my programs end..

This is using Allegro 4.2.0 under Windows XP with AllegroGL (SVN) + OpenLayer (SVN)

A search on the forums revealed some problems a few years ago. Has this problem ever being totally fixed, or is it a windows issue?

Cheers!
Rich.

BAF
Member #2,981
December 2002
avatar

I noticed that problem for the 15-20 minutes I worked on minorhack last weekend. I figured it was some bug in my program, and I ended up not finishing due to lack of time.

Richard Phipps
Member #1,632
November 2001
avatar

Hmmm.. If it is a bug in Allegro it really should be fixed. Especially since it's been reported for a few years. Unfortunately it's very rare on my machine, but some PC's with certain gfx cards (we've had it happen a few times with an old RAGE 128 Pro) do seem to have this problem a lot more. Of course, it may not be the gfx card, it may be the other hardware or software on the PC.

Thomas Fjellstrom
Member #476
June 2000
avatar

Last I heard, this was a DX problem. Could be wrong though.

--
Thomas Fjellstrom - [website] - [email] - [Allegro Wiki] - [Allegro TODO]
"If you can't think of a better solution, don't try to make a better solution." -- weapon_S
"The less evidence we have for what we believe is certain, the more violently we defend beliefs against those who don't agree" -- https://twitter.com/neiltyson/status/592870205409353730

BAF
Member #2,981
December 2002
avatar

No other DX games and such that I have do that.

Evert
Member #794
November 2000
avatar

As far as I know, it was a race condition that was fixed long ago.
This is with vanilla Allegro though, I don't know af AllegroGL has the same possible problem. At any rate, check if you can reproduce the bug with vanilla Allegro.

Quote:

Hmmm.. If it is a bug in Allegro it really should be fixed.

Richard, you sometimes put me on edge with comments like that. Of course bugs should be fixed.

Richard Phipps
Member #1,632
November 2001
avatar

Evert: Thanks for the info!

BAF, did you use just Allegro, or AllegoGL as well?

Quote:

Richard, you sometimes put me on edge with comments like that. Of course bugs should be fixed.

Sorry, I thought it might have been forgotten a few years back. :-/

BAF
Member #2,981
December 2002
avatar

Vanilla Allegro. As I said, I may have had some buggy code myself.

Milan Mimica
Member #3,877
September 2003
avatar

Quote:

I don't know af AllegroGL has the same possible problem.

Anyone knows what the problem was?

Kitty Cat
Member #2,815
October 2002
avatar

Double check all your memory allocations/deallocations/accesses. Sometimes if you play with memory you aren't supposed to, the program will go fine until sometime after main is finished, where it'll hang. I don't know if there's any Windows program to do it for GCC-made programs, though.

--
"Do not meddle in the affairs of cats, for they are subtle and will pee on your computer." -- Bruce Graham

Richard Phipps
Member #1,632
November 2001
avatar

KC: Fortify can track memory overruns.

I'm not sure about a memory overrun, I'm mainly using STL.

Evert
Member #794
November 2000
avatar

Quote:

Vanilla Allegro. As I said, I may have had some buggy code myself.

Thanks, but I actually meant to ask Richard.

Quote:

I thought it might have been forgotten a few years back.

Next time, check the changelog before assuming something wasn't looked into:

Quote:

==============================================================================
============ Changes from 4.2.0 beta 2 to 4.2.0 beta 3 (May 2005) ============
==============================================================================
[...]
Elias Pschernig fixed Allegro's internal multithreading in Windows. This
fixes a deadlock on exit.
[...]
==================================================================
============ Changes from 4.1.11 to 4.1.12 (Nov 2003) ============
==================================================================
[...]
Eric Botcazou changed the default switch mode to SWITCH_BACKGROUND for
the Windows port to cure the problems on exit under WinXP.

Doesn't nescessarily mean it's fixed, but problems of this kind have been looked into.

Richard Phipps
Member #1,632
November 2001
avatar

I apologise if I annoyed you Evert. That wasn't my intention. :(

Quote:

Eric Botcazou changed the default switch mode to SWITCH_BACKGROUND for
the Windows port to cure the problems on exit under WinXP.

Does anyone know if this is changed when Allegro runs it's exits procedure? I do change the switch mode ingame to deal with alt-tabbing. Does anyone think this might occasionally cause a problem?

Thanks. :)

Elias
Member #358
May 2000

From the code, it seems not. Can you check if resetting the switch mode helps (call set_display_switch_mode(BACKGROUND) before exiting)?

In that case a patch like below maybe would help (completely untested).

Index: src/win/wsystem.c
===================================================================
--- src/win/wsystem.c  (revision 7510)
+++ src/win/wsystem.c  (working copy)
@@ -214,6 +214,9 @@
    _free_win_digi_driver_list();
    _free_win_midi_driver_list();
 
+   /* make sure we are not paused and deadlock */
+   _win_reset_switch_mode();
+
    /* unhook or close window */
    exit_directx_window();

--
"Either help out or stop whining" - Evert

Richard Phipps
Member #1,632
November 2001
avatar

Unfortunately it's very very rare on my machine.. Perhaps Baf can help test this with his machine? :)

BAF
Member #2,981
December 2002
avatar

It's rare for me too, I'll see if I can get it to reproduce itself then test the patch.

Richard Phipps
Member #1,632
November 2001
avatar

Go to: