Fix memory leak due to ~ScriptGroup does not clear alloc refs

Change-Id: I6920487d88c8a0c6850d533cdf2f89bb1464bbae
Signed-off-by: Yong Chen <[email protected]>
diff --git a/rsScriptGroup.cpp b/rsScriptGroup.cpp
index 791ab14..45a53e4 100644
--- a/rsScriptGroup.cpp
+++ b/rsScriptGroup.cpp
@@ -36,6 +36,14 @@
     for (auto link : mLinks) {
         delete link;
     }
+
+    for (auto input : mInputs) {
+        input->mAlloc.clear();
+    }
+
+    for (auto output : mOutputs) {
+        output->mAlloc.clear();
+    }
 }
 
 ScriptGroup::IO::IO(const ScriptKernelID *kid) {