Page 1 of 1

[ANSWER = "No"] Share CHOOSER_Labels list?

Posted: Sun Feb 23, 2014 9:24 pm
by gazelle
Is it allowed to share a labellist for choosers? I didn't find anything in the docs. It works so far.

There also seems to be a bug with freeing the allocated nodes. According to the autodocs, the nodes should be freed on disposal.
CHOOSER_Labels (struct List *)
List of labels. Each node must be allocated with the AllocChooserNodeA() function. The list will be freed automatically when the object is disposed of.
But when I do (after DisposeObject() ):

Code: Select all

while ( (node = IExec->RemHead(list)) )
{
	IChooser->FreeChooserNode(node);
}
I get the full list of nodes and no memguard hit for freeing something twice.

Re: Share CHOOSER_Labels list?

Posted: Sun Feb 23, 2014 10:21 pm
by salass00
That must be a mistake in the autodoc because the labels list is only freed automatically on DisposeObject() if it was created by the chooser class, that is if you used CHOOSER_LabelArray instead of CHOOSER_Labels.

I just fixed it in the SVN.

Re: Share CHOOSER_Labels list?

Posted: Sun Feb 23, 2014 10:30 pm
by gazelle
Ok, thanks.

What about the real question to share the list for different choosers?

Re: Share CHOOSER_Labels list?

Posted: Sun Feb 23, 2014 10:45 pm
by salass00
gazelle wrote:Ok, thanks.

What about the real question to share the list for different choosers?
Well sharing the list shouldn't be a problem with the current chooser.gadget code at least.

Re: [ANSWERED] Share CHOOSER_Labels list?

Posted: Sun Feb 23, 2014 11:07 pm
by gazelle
Thanks again. I can confirm that it works, no reaper so far (and I'm doing it since some days).

Re: [ANSWERED] Share CHOOSER_Labels list?

Posted: Mon Feb 24, 2014 3:11 am
by ssolie
gazelle wrote:Thanks again. I can confirm that it works, no reaper so far (and I'm doing it since some days).
Objects (lists, etc.) that you pass control over to a BOOPSI object should never be shared unless explicitly written otherwise. You are just asking for trouble.

Re: [ANSWERED] Share CHOOSER_Labels list?

Posted: Mon Feb 24, 2014 9:50 am
by gazelle
ssolie wrote:Objects (lists, etc.) that you pass control over to a BOOPSI object should never be shared unless explicitly written otherwise. You are just asking for trouble.
That's what I feared, but it worked so well. Ok, time to restructure my code than.