{"record":{"id":"f1a31f6190ac986b","repo":"wailsapp/wails","slug":"globalfree-failed","errorCode":null,"errorMessage":"GlobalFree failed","messagePattern":"GlobalFree failed","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"v3/pkg/w32/kernel32.go","lineNumber":135,"sourceCode":"}\n\nfunc GlobalAlloc(uFlags uint, dwBytes uint32) HGLOBAL {\n\tret, _, _ := procGlobalAlloc.Call(\n\t\tuintptr(uFlags),\n\t\tuintptr(dwBytes))\n\n\tif ret == 0 {\n\t\tpanic(\"GlobalAlloc failed\")\n\t}\n\n\treturn HGLOBAL(ret)\n}\n\nfunc GlobalFree(hMem HGLOBAL) {\n\tret, _, _ := procGlobalFree.Call(uintptr(hMem))\n\n\tif ret != 0 {\n\t\tpanic(\"GlobalFree failed\")\n\t}\n}\n\nfunc GlobalLock(hMem HGLOBAL) unsafe.Pointer {\n\tret, _, _ := procGlobalLock.Call(uintptr(hMem))\n\n\tif ret == 0 {\n\t\tpanic(\"GlobalLock failed\")\n\t}\n\n\treturn unsafe.Pointer(ret)\n}\n\nfunc GlobalUnlock(hMem HGLOBAL) bool {\n\tret, _, _ := procGlobalUnlock.Call(uintptr(hMem))\n\n\treturn ret != 0\n}","sourceCodeStart":117,"sourceCodeEnd":153,"githubUrl":"https://github.com/wailsapp/wails/blob/0e754b1b40ba9044c2a1460e23b7c3de20fc5cf3/v3/pkg/w32/kernel32.go#L117-L153","documentation":"Error \"GlobalFree failed\" thrown in wailsapp/wails.","triggerScenarios":"Occurs when GlobalFree returns non-NULL, indicating the memory handle is invalid or the memory has already been freed.","commonSituations":"See trigger scenarios.","solutions":["Only free a handle returned by GlobalAlloc; freeing an invalid, already-freed, or locked memory handle makes GlobalFree fail.","Unlock the memory with GlobalUnlock before freeing it if it is still locked.","Set the handle to zero after freeing and do not use it again to avoid double-free failures."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"0e754b1b40ba9044c2a1460e23b7c3de20fc5cf3","analyzedAt":"2026-08-15T14:17:36.034Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}