[PR #641] [MERGED] fix(renderer): add errdefer cleanup in createWithOptions #1458

Closed
opened 2026-03-14 09:37:55 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/anomalyco/opentui/pull/641
Author: @simonklee
Created: 2/7/2026
Status: Merged
Merged: 2/7/2026
Merged by: @kommander

Base: mainHead: renderer-errdefer


📝 Commits (1)

  • 88a38d3 fix(renderer): add errdefer cleanup in createWithOptions

📊 Changes

2 files changed (+39 additions, -0 deletions)

View changed files

📝 packages/core/src/zig/renderer.zig (+12 -0)
📝 packages/core/src/zig/tests/renderer_test.zig (+27 -0)

📄 Description

Prevent leaks when late allocations fail during renderer initialization. Each fallible allocation now has a corresponding errdefer to free previously acquired resources on error.

Similar to #640


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/anomalyco/opentui/pull/641 **Author:** [@simonklee](https://github.com/simonklee) **Created:** 2/7/2026 **Status:** ✅ Merged **Merged:** 2/7/2026 **Merged by:** [@kommander](https://github.com/kommander) **Base:** `main` ← **Head:** `renderer-errdefer` --- ### 📝 Commits (1) - [`88a38d3`](https://github.com/anomalyco/opentui/commit/88a38d3c3b68774f0e884d66149b177af1a6409f) fix(renderer): add errdefer cleanup in createWithOptions ### 📊 Changes **2 files changed** (+39 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `packages/core/src/zig/renderer.zig` (+12 -0) 📝 `packages/core/src/zig/tests/renderer_test.zig` (+27 -0) </details> ### 📄 Description Prevent leaks when late allocations fail during renderer initialization. Each fallible allocation now has a corresponding errdefer to free previously acquired resources on error. Similar to #640 --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-03-14 09:37:55 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/opentui#1458
No description provided.