Skip to content

Commit a74b261

Browse files
committed
FEAT: provide info, when molding a released handle, that it is already released
1 parent 922ac06 commit a74b261

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

src/core/s-mold.c

+4
Original file line numberDiff line numberDiff line change
@@ -555,6 +555,10 @@ STOID Mold_Handle(REBVAL *value, REB_MOLD *mold)
555555
if (name != NULL) {
556556
Append_Bytes(mold->series, "#[handle! ");
557557
Append_Bytes(mold->series, cs_cast(name));
558+
if (IS_CONTEXT_HANDLE(value)) {
559+
if (!IS_USED_HOB(VAL_HANDLE_CTX(value)))
560+
Append_Bytes(mold->series, " unset!");
561+
}
558562
Append_Byte(mold->series, ']');
559563
}
560564
else {

src/os/host-ext-test.c

+4-2
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,8 @@ char *RX_Spec =
132132

133133
// Sometimes handle may depend on another handle.. this test simulates it.
134134
"[y: hob1/with #{00} x x: none print [{The new handle keeps reference to the second handle:} mold y/data y/data/2/id]]\n"
135+
// Manually releasing a handle...
136+
"[print [{Relasing:} y] release y print [{Result:} y {should have no data:} y/data]]\n"
135137

136138
"[h: hndl1]\n"
137139
"[hndl2 h]\n"
@@ -186,7 +188,7 @@ REBCNT Test_Sync_Callback(REBSER *obj, REBCNT word, RXIARG *result)
186188
RXIARG args[4];
187189
REBCNT n;
188190

189-
printf("Test_Sync_Callback: ");
191+
//printf("Test_Sync_Callback: ");
190192

191193
// These can be on the stack, because it's synchronous.
192194
CLEAR(&cbi, sizeof(cbi));
@@ -214,7 +216,7 @@ REBCNT Test_Async_Callback(REBSER *obj, REBCNT word)
214216
RXIARG *args;
215217
REBCNT n;
216218

217-
printf("Test_Async_Callback: ");
219+
//printf("Test_Async_Callback: ");
218220

219221
// These cannot be on the stack, because they are used
220222
// when the callback happens later.

0 commit comments

Comments
 (0)