Skip to content

Commit 6a990fe

Browse files
3vcloudclaude
andcommitted
docs(dat): note why the fetch trigger must stay non-cancelable (no leak)
The request function internally allocs a request batch and frees it itself (FUN_007cdea0 reclaims it after dispatch), and returns only an int cancel token we discard - so flags=0 is fire-and-forget with nothing to release. A cancelable flag would hand back a handle that leaks if not released. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent 09f70c8 commit 6a990fe

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

GWToolboxdll/Modules/GwDatTextureModule.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,10 @@ namespace {
2121
// Asks the client to fetch a file id (dat or network). Found via its unique DOWNLOAD_FLAG assert
2222
// string (survives client updates); safe in-game and enqueue-only - the client pumps its own queue.
2323
using RequestFiles_pt = void(__cdecl*)(uint32_t count, const uint32_t* file_ids, uint32_t flags);
24-
constexpr uint32_t kTriggerFlags = 0; // normal priority, non-cancelable
24+
// 0 = normal priority, non-cancelable: the client owns and frees the request batch itself, so it's
25+
// fire-and-forget with nothing to release. Do NOT add a cancelable flag (0x1/0x10000) - those
26+
// return a handle that must be released or it leaks.
27+
constexpr uint32_t kTriggerFlags = 0;
2528
RequestFiles_pt RequestFiles_Func = nullptr;
2629

2730
void WireGameFileTrigger()

0 commit comments

Comments
 (0)