File tree Expand file tree Collapse file tree 1 file changed +12
-1
lines changed
Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Original file line number Diff line number Diff 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+
112123vtable_wrap_mode d3d9_wrapper_event_state[METHOD_WRAP_COUNT] = { WRAP_PASSTHRU };
113124
114125void 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
You can’t perform that action at this time.
0 commit comments