tp: switch SqliteTable subclass constructors to take a pointer This CL changes the constructor of SqliteTable sublcasses to be forced to take a pointer in their constructor. This is necessary to work around subtle lifetime issues for kExlicitCreate tables and is the simplest possible solution here. This unblocks CREATE PERFETTO TABLE implementation and migration. Change-Id: I602911e658283b0d3021138726e1748a0656bd0f
diff --git a/src/trace_processor/sqlite/sqlite_table.h b/src/trace_processor/sqlite/sqlite_table.h index 245fe7c..3f7c3bd 100644 --- a/src/trace_processor/sqlite/sqlite_table.h +++ b/src/trace_processor/sqlite/sqlite_table.h
@@ -356,8 +356,7 @@ sqlite3_vtab** tab, char** pzErr) { auto* xdesc = static_cast<ModuleArg*>(arg); - std::unique_ptr<SubTable> table( - new SubTable(xdb, std::move(xdesc->context))); + std::unique_ptr<SubTable> table(new SubTable(xdb, &*xdesc->context)); SubTable* table_ptr = table.get(); base::Status status = table->InitInternal(xdesc->engine, argc, argv); if (!status.ok()) {