Skip to content

Use Ada.Finalization types for Problems and Plotters #7

Description

@rocher

Introduction

GUI Runner of Gnoga Multi-connection application uses a derived Connection_Data_Type record. In it, some fields are pointers to objects dynamically allocated. For example, each connection requires a different Problem instance. On_Connection event, the Problem factory passed to the Gnoga Runner creates a new Problem object. The pointer is placed into the connection data, so that no user interaction with the Problem do not interfere with other user Problems.

When the connection is closed (either the TAB browser is closed of F5 is pressed in a TAB), the connection data is finalized, but there is no way to de-allocate the memory previously allocated by the Runner.

Initial experiment was done by making Connection_Data_Type in Gnoga.Types to be a new Ada.Finalization.Limited_Controlled type, but unsuccessfully. See this Gnoga branch and this Alice branch for more information.

DoD — The GUI Runner is able to de-allocate previously dynamic memory allocated for a Problem using the Problem factory.

Tasks

  • Investigate if Gnoga already allows de-allocating such memory (in principle look like it is not possible)
  • Prepare a Gnoga pull request if a solution is found that requires modifying Connection_Data_Type
  • Adapt changes in GUI Gnoga Runner

Metadata

Metadata

Assignees

Labels

backlogSpecified in the project backlog

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions