Skip to content

Add missing destructor methods (C#)#109

Merged
omckeon merged 3 commits intothoth-tech:t1-2025from
sam-stajnko:destructor_methods
Jun 18, 2025
Merged

Add missing destructor methods (C#)#109
omckeon merged 3 commits intothoth-tech:t1-2025from
sam-stajnko:destructor_methods

Conversation

@sam-stajnko
Copy link
Copy Markdown

@sam-stajnko sam-stajnko commented May 6, 2025

Description

The destructor method is generally used for freeing resources and memory when a class is no longer needed by the program. Some classes are lacking a local method that allows you to call the destructor which means that if you want to call the destructor from outside the class, you need to use the function that takes a class instance as a parameter:

eg. FreeWindow(Window wnd) instead of wnd.Free()

Realistically, both should exist but there are cases where the destructor method is missing.

Fixes

The missing method attribute has been added to the header docs for the following functions:

  • FreeJson
  • FreeMusic
  • FreeTimer
  • FreeAnimation
  • FreeAnimationScript
  • CloseAdc

Then the translator was ran to generate the api.json and SplashKit.cs files.

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Documentation (update or new)

How Has This Been Tested?

  • Checked api.json to see if the correct signatures were generated
  • Checked SplashKit.cs to see if the destructor methods were added to the relevant class

(Both of the above files are located in the generated folder)

Testing Checklist

  • Does api.json contain the signatures for the missing method(s)?
  • Were the missing destructor methods generated for the relevant class in the SplashKit.cs file

Checklist

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings

Copy link
Copy Markdown

@dijidiji dijidiji left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've got no changes to suggest, approving.

How has this been tested?

  • Copy api.json to local splaskit.io-starlight
  • npm run build
  • npm run preview

Confirmed that api.json has destructor methods for the following and that they show up on the site in local testing:

  • FreeJson
  • FreeMusic
  • FreeTimer
  • FreeAnimation
  • FreeAnimationScript
  • CloseAdc

Too many screenshots to be practical, but they all show up similarly in the API documentation:
image
image

Confirmed that the methods were generated for the following in SplashKit.cs:

  • FreeJson
  • FreeMusic
  • FreeTimer
  • FreeAnimation
  • FreeAnimationScript
  • CloseAdc

Copy link
Copy Markdown

@Oliver-Quail Oliver-Quail left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @sam-stajnko,

I've read over your code changes and the previous review. I have no feedback to improve this PR. I approve this PR

@omckeon omckeon self-assigned this May 31, 2025
@omckeon omckeon changed the base branch from develop to t1-2025 June 16, 2025 14:40
@omckeon omckeon merged commit cb3d97e into thoth-tech:t1-2025 Jun 18, 2025
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants