Gamestudio Links
Zorro Links
Newest Posts
Data from CSV not parsed correctly
by EternallyCurious. 04/25/24 10:20
Trading Journey
by howardR. 04/24/24 20:04
M1 Oversampling
by Petra. 04/24/24 10:34
Zorro FIX plugin - Experimental
by flink. 04/21/24 07:12
Scripts not found
by juergen_wue. 04/20/24 18:51
zorro 64bit command line support
by 7th_zorro. 04/20/24 10:06
StartWeek not working as it should
by jcl. 04/20/24 08:38
folder management functions
by VoroneTZ. 04/17/24 06:52
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
4 registered members (AndrewAMD, Quad, EternallyCurious, 1 invisible), 726 guests, and 5 spiders.
Key: Admin, Global Mod, Mod
Newest Members
Mega_Rod, EternallyCurious, howardR, 11honza11, ccorrea
19048 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