Lsan: fix invalid memory access

The chart object can be destroyed after the context.

Change-Id: I5ae370638f296ea314ee11680e0a8d81a8fdbe69
Lsan: fix memory leaks

Change-Id: I35adb022f12c6833f4f29b2e8dad44394a2c4be5
Lsan: fix memory leaks

Change-Id: I010c7c194bf0680a499077b6b364498a09542764
Lsan: fix memory leak

Change-Id: Id8adb7517960a33f9900cb773b62b84db71e795a
Lsan: fix memory leak

Change-Id: I82a517a267cceaac4dd1030d45c67fc070e22def