Skip to content

Commit c97d583

Browse files
committed
added client upload call on d3d9 obj final release
1 parent 86fdaeb commit c97d583

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

addon/d3d9_wrapper.cpp

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,17 @@ void OnPostWrappedRelease(wrap_event_data* data)
109109
}
110110
}
111111

112+
void OnPostObjWrappedRelease(wrap_event_data* data)
113+
{
114+
if (*((LONG*)data->ret) == 0)
115+
{
116+
free(*data->stackPtr);
117+
118+
//TODO: find more nice way to detect client unload
119+
gAPI->client_unload();
120+
}
121+
}
122+
112123
vtable_wrap_mode d3d9_wrapper_event_state[METHOD_WRAP_COUNT] = { WRAP_PASSTHRU };
113124

114125
void d3d9_wrapper_enable_event(d3d9_vtable_method method, vtable_wrap_mode mode)
@@ -176,7 +187,7 @@ gw2al_api_ret gw2addon_load(gw2al_core_vtable* core_api)
176187
gAPI->watch_event(
177188
gAPI->query_event(gAPI->hash_name((wchar_t*)L"D3D9_POST_OBJ_Release")),
178189
gAPI->hash_name((wchar_t*)L"d3d9 wrapper"),
179-
(gw2al_api_event_handler)&OnPostWrappedRelease,
190+
(gw2al_api_event_handler)&OnPostObjWrappedRelease,
180191
0
181192
);
182193

0 commit comments

Comments
 (0)