Skip to content
Back to skills

Extension Signal Cleanup

ASecurity

This is the preferred pattern for all objects that support it. Pass this as the final argument and calling disconnectObject on this in destroy or disable cleans all handlers at once.

  • 14 stars
  • 0 votes
  • 0 copies
  • 3 views
  • Added September 19, 2026
toolsgo

Security analysis

A100/100

Scanned September 19, 2026

npx -y skills add itsnin/spotlight --skill extension-signal-cleanup --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Extension Signal Cleanup?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Extension Signal Cleanup
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/itsnin-extension-signal-cleanup/badge)](https://www.skillsdirectory.com/skills/itsnin-extension-signal-cleanup)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
# extension-signal-cleanup

## connectObject

This is the preferred pattern for all objects that support it. Pass this as the final argument and calling disconnectObject on this in destroy or disable cleans all handlers at once.

## Plain Connect

Use plain connect for signals that need to stay connected across open and close cycles. Store the handler ID in this._someId and call disconnect with the explicit ID during cleanup. An example would be the overview key capture in Spotlight that persists while the extension is enabled.

## Never Mix Lifetimes

Never mix persistent and ephemeral signals on the same `(GObject, owner)` pair. `disconnectObject(owner)` removes ALL handlers for that owner on that object at once. If some signals must persist across open/close cycles while others are installed per-open, use plain `connect` with explicit ID tracking for one lifetime and `connectObject` for the other. Or use different owner objects for each lifetime scope.

Do not use plain connect for objects that support connectObject when the lifetimes match, because it causes leaks.

## Short-Lived Widgets

Plain connect is safe for short-lived widgets because GObject auto-disconnects on finalize.

## Scope Safety in Cleanup Functions

Never reference module imports or closure variables in cleanup functions that may be called from a different scope. If a signal needs a settings object for cleanup, store it on the owner (e.g. `popup._ifaceSettings`) and access it through the owner parameter, or pass it as an explicit argument. A bare `ifaceSettings` reference inside a cleanup function that does not import or receive it will throw `ReferenceError` at disable time.

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.