Grpc Graph - fix use after free

GrpcGraph initializes StreamSetObserver - which triggers a thread to
notify GrpcGraph of termination. If GrpcGraph is destroyed, this will
result in use after free. Fix this by enforcing that GrpcGraph object is
not destroyed before StreamSetObserver.

Bug: 170407229
Test: build, unit test and fuzz test
Change-Id: I8b24f72af60c441ebd7a31939769c46589431cfe
Merged-In: I8b24f72af60c441ebd7a31939769c46589431cfe
(cherry picked from commit 3f53bf0525bd5c21ff6cc3235b93cb26a7866ea8)
4 files changed
tree: 1bd61629a603622ec1f60ee173a1399f49030d78
  1. EncryptionRunner/
  2. FrameworkPackageStubs/
  3. car-bugreportd/
  4. car-default-input-service/
  5. car-internal-lib/
  6. car-lib/
  7. car-maps-placeholder/
  8. car-systemtest-lib/
  9. car-test-lib/
  10. car-usb-handler/
  11. car_product/
  12. computepipe/
  13. evs/
  14. experimental/
  15. obd2-lib/
  16. packages/
  17. procfs-inspector/
  18. service/
  19. surround_view/
  20. tests/
  21. tools/
  22. user/
  23. vehicle-hal-support-lib/
  24. watchdog/
  25. .clang-format
  26. .gitignore
  27. Android.mk
  28. CPPLINT.cfg
  29. CleanSpec.mk
  30. OWNERS
  31. PREUPLOAD.cfg
  32. README.md
  33. TEST_MAPPING
README.md

Native (C++) code format is required to be compatible with .clang-format file. Run

git clang-format --style=file --extension='h,cpp,cc' HEAD~

Note that clang-format is not desirable for Android java files. Therefore the command line above is limited to specific extensions.