Lifecycle Hooks and Sandbox

When hooks run, how failures are isolated, and what cleanup is required.

Roneat Studio Pro triggers lifecycle hooks at specific moments.

Use the right hook for the right job.

Available hooks

on_load

Runs as soon as the module is imported.

Use it for early setup and background preparation.

on_app_start

Runs when the application is fully loaded and visible.

Use it for UI injection, windows, menus, and plugin-facing controls.

on_project_open

Runs when the user opens a .roneat project.

Use it to inspect or adapt project state.

on_project_save

Runs just before the current project is written to disk.

Use it for validation or last-minute state updates.

on_unload

Runs when the plugin is disabled or uninstalled.

Use it to stop threads, close files, and release external resources.

Sandbox behavior

The v2.2.0 engine isolates plugin failures from the main app.

In practice, the sandbox is designed to be crash-resistant.

If a plugin raises a critical exception:

  • the traceback is logged to the GUI console

  • an error toast is shown

  • the plugin is disabled safely

  • the main app stays stable

  • user data stays protected

Automatic state reversion

Theme and language changes are reversible.

If your plugin changes the UI state and is later disabled, Roneat Studio restores the original defaults automatically.

Threading guidance

Never block the main thread with a permanent loop.

Use a background worker instead.

Cleanup checklist

Before unload completes, make sure you:

  • stop background workers

  • close files and streams

  • release hardware handles

  • stop custom audio playback if needed

circle-check

Last updated

Was this helpful?