[Ohrrpgce] SVN: james/9958 load_plank_from_file() helper function

James Paige Bob at hamsterrepublic.com
Fri Jan 12 08:19:45 PST 2018


Opps! I'll fix where I forgot to free the collection in SliceLoadFromFile
It looks like I am leaking the whole collection every time, even if the
load succeeds.

I'm looking forward to learning more about template slices and menu slices.
I'll probably have to read your writeup before I understand :)

---
James




On Fri, Jan 12, 2018 at 8:04 AM, Ralph Versteegen <teeemcee at gmail.com>
wrote:

>
>
> On 12 January 2018 at 13:00, <subversion at hamsterrepublic.com> wrote:
>
>> james
>> 2018-01-11 16:00:45 -0800 (Thu, 11 Jan 2018)
>> 38
>> load_plank_from_file() helper function
>> ---
>> U   wip/plankmenu.bas
>> U   wip/plankmenu.bi
>>
>
> + DIM col as Slice Ptr
> + col = NewSliceOfType(slSpecial)
> + SliceLoadFromFile col, filename
> + IF col = 0 THEN visible_debug "load_plank_from_file: unable to load
> slices from """ & filename & """": RETURN 0
>
> This doesn't work:  if SliceLoadFromFile fails, it doesn't delete col.
>
> I actually have a git branch where I was working on making
> SliceLoadFromFile return a new slice instead of modify an existing one.
> Which was a surprisingly large change. I don't remember why I didn't check
> that in; maybe it didn't seem worth the effort to finish it.
>
> BTW, I have been working on changing the way that plankmenus work. I am
> getting rid of "plank" collections and instead using template slices
> parented directly to the menu slice collection. Oh... I didn't check in
> template slices yet either? Well, it's basically just another Slice bit
> which works very similarly to Slice.Visible. Well, after planks are gone
> maybe plank menus should be renamed... I have a suggestion: Menu Slices. As
> in, promote them to a new slice type so that they can be used by scripts
> too, not just from FB. I have a long writeup about this which I haven't
> finished yet...
>
> _______________________________________________
> Ohrrpgce mailing list
> ohrrpgce at lists.motherhamster.org
> http://lists.motherhamster.org/listinfo.cgi/ohrrpgce-motherhamster.org
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.motherhamster.org/pipermail/ohrrpgce-motherhamster.org/attachments/20180112/c9d5499a/attachment.html>


More information about the Ohrrpgce mailing list