Passthrough oneway: keep hold on mImpl

Test: hidl_test
Bug: 37675100
Change-Id: I86815cc95091c6f439dffff975dfe81d330d9340
diff --git a/generateCpp.cpp b/generateCpp.cpp
index ecf058b..b675ac0 100644
--- a/generateCpp.cpp
+++ b/generateCpp.cpp
@@ -691,7 +691,10 @@
     out << "auto _hidl_return = ";
 
     if (method->isOneway()) {
-        out << "addOnewayTask([this, &_hidl_error";
+        out << "addOnewayTask([mImpl = this->mImpl, "
+               "mEnableInstrumentation = this->mEnableInstrumentation, "
+               "mInstrumentationCallbacks = this->mInstrumentationCallbacks, "
+               "&_hidl_error";
         for (const auto &arg : method->args()) {
             out << ", "
                 << (arg->type().isInterface() ? "_hidl_wrapped_" : "")
@@ -699,7 +702,6 @@
         }
         out << "] {\n";
         out.indent();
-        out << "this->";
     }
 
     out << "mImpl->"