Gamestudio Links
Zorro Links
Newest Posts
Blobsculptor tools and objects download here
by NeoDumont. 03/28/24 03:01
Issue with Multi-Core WFO Training
by aliswee. 03/24/24 20:20
Why Zorro supports up to 72 cores?
by Edgar_Herrera. 03/23/24 21:41
Zorro Trader GPT
by TipmyPip. 03/06/24 09:27
VSCode instead of SED
by 3run. 03/01/24 19:06
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
1 registered members (opm), 778 guests, and 4 spiders.
Key: Admin, Global Mod, Mod
Newest Members
sakolin, rajesh7827, juergen_wue, NITRO_FOREVER, jack0roses
19043 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 2 of 2 1 2
Re: Crash on removing locally created panels using ptr_remove [Re: jcl] #473428
07/04/18 14:51
07/04/18 14:51
Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
Superku Offline
Senior Expert
Superku  Offline
Senior Expert

Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
Originally Posted By: jcl
removing a different panel that shares a bitmap [...]
ptr_remove just releases the memory of the panel and all its bitmaps.

Hmm what does that mean exactly when we look at the following cases:
Code:
=== CASE 1 === 
BMAP* compass_map = "compass.pcx"; 
PANEL* aircraft_pan =
{
   bmap = compass_map; // compass_map as panel background
   flags = SHOW;
}

=== CASE 2 === 
Same as in 1 but bmap pointer (globally or locally created) dynamically assigned - most likely the same?

=== CASE 3 === 
PANEL* splashscreen = { bmap = "splash.pcx"; } // creates a bmap splash_pcx

=== CASE 4 === 
PANEL* pnlDynamic = pan_create("...");
no panel background bmap
pan_setwindow(pnlDynamic, ...,BMAPPOINTER,...);



In which of those 4 cases are bitmaps being freed?


EDIT:
Originally Posted By: jcl
It's clear that when you use a local panel pointer, and something happens to that panel while the function is still running, it will crash.

I do not understand what this means, can you rephrase that sentence please? confused
In Turrican's situation the panel is created locally inside the function, not used in or "exposed" to any other function. Yet it crashes on removal. (EDIT2: Panel confirmed to be still in the C_LINK list before ptr_remove.)

Last edited by Superku; 07/05/18 14:17.

"Falls das Resultat nicht einfach nur dermassen gut aussieht, sollten Sie nochmal von vorn anfangen..." - Manual

Check out my new game: Pogostuck: Rage With Your Friends
Re: Crash on removing locally created panels using ptr_remove [Re: Superku] #473443
07/06/18 23:08
07/06/18 23:08
Joined: Sep 2003
Posts: 9,859
F
FBL Offline
Senior Expert
FBL  Offline
Senior Expert
F

Joined: Sep 2003
Posts: 9,859
I think the point is you *could* do something harmful (like removing a referenced BMAP) in some other function which is running during wait(1).

If the examples above are to be considered standalone, meaning nothing else is running during the wait(1), this of course does not apply.

Page 2 of 2 1 2

Moderated by  old_bill, Tobias 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1