RISC OS Open
Safeguarding the past, present and future of RISC OS for everyone
ROOL
Home | News | Downloads | Bugs | Bounties | Forum | Documents | Photos | Contact us
Account

Previous|Next

  • Tickets
  • » Ticket #215

Ticket #215 (Fixed)Tue Jul 21 15:18:28 UTC 2009

TextGadgets claims MORE from RMA when a gadget is removed andothers of the same type remain.

Reported by: Christopher Bazley (288) Severity: Minor
Part: RISC OS: Module Release:
Milestone: Status Fixed

Details by Christopher Bazley (288):

When a Scrollbar, ScrollList or TextArea gadget is removed, the TextGadgets module makes a hamfisted attempt to shrink the RMA block containing its array of pointers to the internal data structures for that type of gadget. The only exception is when removing the final gadget, when the RMA block is instead freed.

Unfortunately, the RMA block is expanded to a silly size instead of being shrunk, because the wrong type specifier is used with the ‘sizeof’ operator (e.g. ‘PrivateScrollbar’ instead of ‘PrivateScrollbar *’):

// No need to generate an error if the realloc fails, ’cos // it’ll just realloc next time, hopefully new_list = realloc(scrollbar_list, sizeof(PrivateScrollbar) * (j+1));

Tragically this isn’t the only thing wrong with the calculation: The comments saying “j points to last entry” are a lie; j is actually the index of the NULL terminator (i.e. the number of gadgets). Therefore ‘j+1’ should be the current number of array elements, which isn’t appropriate as the new number of array elements.

Changelog:

Modified by Sprow (202) Sun, February 28 2010 - 10:44:42 GMT

  • Status changed from Open to Fixed

Hopefully fixed in Gadgets 0.31.

  • Comment on, or change status of, this ticket

Previous|Next

Search tickets

Social

Follow us on and

ROOL Store

Buy RISC OS Open merchandise here, including SD cards for Raspberry Pi and more.

Donate! Why?

Help ROOL make things happen – please consider donating!

RISC OS IPR

RISC OS is an Open Source operating system owned by RISC OS Developments Ltd and licensed primarily under the Apache 2.0 license.

Options

  • Tickets
  • New ticket
  • Milestones
  • Subversion: Changesets
  • Subversion: Browse
  • CVS: Revisions
  • CVS: Browse
  • Search

RSS feeds Rss

  • Tickets
  • Everything!
  • More feeds...
Site design © RISC OS Open Limited 2018 except where indicated
The RISC OS Open Collaboa theme is distantly based on the Collaboa default layout

Valid XHTML 1.0  |  Valid CSS

Powered by Collaboa
This site runs on Rails

Hosted by Arachsys