Avoid leaks on fuzzer exit.

A final GC is required to ensure off-heap objects are
collected prior to exit.

Bug: chromium:1131837
Change-Id: I1ae688e9a82f6c07dadb6b3d37c43670fd0c1581
Reviewed-on: https://pdfium-review.googlesource.com/c/pdfium/+/73971
Reviewed-by: Lei Zhang <thestig@chromium.org>
Commit-Queue: Tom Sepez <tsepez@chromium.org>
diff --git a/testing/fuzzers/xfa_process_state.cc b/testing/fuzzers/xfa_process_state.cc
index a95b22f..4a6743d 100644
--- a/testing/fuzzers/xfa_process_state.cc
+++ b/testing/fuzzers/xfa_process_state.cc
@@ -9,7 +9,9 @@
 XFAProcessState::XFAProcessState(v8::Platform* platform, v8::Isolate* isolate)
     : platform_(platform), isolate_(isolate), heap_(FXGC_CreateHeap()) {}
 
-XFAProcessState::~XFAProcessState() = default;
+XFAProcessState::~XFAProcessState() {
+  FXGC_ForceGarbageCollection(heap_.get());
+}
 
 cppgc::Heap* XFAProcessState::GetHeap() const {
   return heap_.get();