2 registered members (TipmyPip, 1 invisible),
18,758
guests, and 8
spiders. |
Key:
Admin,
Global Mod,
Mod
|
|
|
Re: Script Crash loves me :(
[Re: Yashas]
#411607
11/18/12 06:26
11/18/12 06:26
|
Joined: Apr 2007
Posts: 3,751 Canada
WretchedSid
Expert
|
Expert
Joined: Apr 2007
Posts: 3,751
Canada
|
You only back Applets with memory, but the structs content remain uninitialized and might very well be something else than NULL. Also, you probably want to build your linked list different using a more common approach like:
typedef struct Applet
{
STRING *Name;
STRING *Author;
STRING *Version;
STRING *Description;
PANEL *Container;
void *Initilize;
void *Deinitlize;
int init;
struct Applet *next;
struct Applet *prev;
} Applet;
Applet *listHead = NULL;
Applet *listTail = NULL;
void RegisterApplet(Applet *applet)
{
if(listHead)
{
applet->next = NULL;
applet->prev = listTaile;
listTail->next = applet;
listTail = applet;
}
else
{
applet->next = applet->prev = NULL;
listTail = applet;
listHead = applet;
}
}
Last edited by JustSid; 11/18/12 06:38. Reason: Forgot a pointer
Shitlord by trade and passion. Graphics programmer at Laminar Research. I write blog posts at feresignum.com
|
|
|
Re: Script Crash loves me :(
[Re: WretchedSid]
#411626
11/18/12 12:20
11/18/12 12:20
|
Joined: Jan 2002
Posts: 4,225 Germany / Essen
Uhrwerk
Expert
|
Expert
Joined: Jan 2002
Posts: 4,225
Germany / Essen
|
...but the structs content remain uninitialized and might very well be something else than NULL. How should that happen?
Always learn from history, to be sure you make the same mistakes again...
|
|
|
Re: Script Crash loves me :(
[Re: Uhrwerk]
#411628
11/18/12 12:53
11/18/12 12:53
|
Joined: Apr 2007
Posts: 3,751 Canada
WretchedSid
Expert
|
Expert
Joined: Apr 2007
Posts: 3,751
Canada
|
...but the structs content remain uninitialized and might very well be something else than NULL. How should that happen? By sys_malloc() not zeroing the allocated memory?
Shitlord by trade and passion. Graphics programmer at Laminar Research. I write blog posts at feresignum.com
|
|
|
Re: Script Crash loves me :(
[Re: MasterQ32]
#411631
11/18/12 13:21
11/18/12 13:21
|
Joined: Jan 2002
Posts: 4,225 Germany / Essen
Uhrwerk
Expert
|
Expert
Joined: Jan 2002
Posts: 4,225
Germany / Essen
|
It sure does. Returns: void* pointer to the allocated memory area, or NULL when the allocation failed. The area is cleared to zero at allocation.
Always learn from history, to be sure you make the same mistakes again...
|
|
|
Re: Script Crash loves me :(
[Re: Uhrwerk]
#411740
11/19/12 13:15
11/19/12 13:15
|
Joined: Apr 2007
Posts: 3,751 Canada
WretchedSid
Expert
|
Expert
Joined: Apr 2007
Posts: 3,751
Canada
|
Well, this is awkward... I'll just slowly walk away now an... GUYS, LOOK, OVER THERE, A CUTE BUNNY *flies away*
Shitlord by trade and passion. Graphics programmer at Laminar Research. I write blog posts at feresignum.com
|
|
|
Re: Script Crash loves me :(
[Re: PadMalcom]
#411755
11/19/12 15:20
11/19/12 15:20
|
Joined: Jan 2002
Posts: 4,225 Germany / Essen
Uhrwerk
Expert
|
Expert
Joined: Jan 2002
Posts: 4,225
Germany / Essen
|
Where is that bunny? Where? *jumps up and down* Where? Did I miss it? Was it cute? OMG. I haven't seen it. :-(
Always learn from history, to be sure you make the same mistakes again...
|
|
|
|