Skip to content

Commit 4f94fbf

Browse files
Googlera-maurice
authored andcommitted
Fix the issue that create_first_app is not set as true when client creates multiple non-default app.
PiperOrigin-RevId: 311624261
1 parent d1c1345 commit 4f94fbf

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

app/src/app_common.cc

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -262,12 +262,14 @@ App* AddApp(App* app, std::map<std::string, InitResult>* results) {
262262
if (IsDefaultAppName(app->name())) {
263263
assert(!g_default_app);
264264
g_default_app = app;
265-
created_first_app = true;
266265
}
267266
UniquePtr<AppData> app_data = MakeUnique<AppData>();
268267
app_data->app = app;
269268
app_data->cleanup_notifier.RegisterOwner(app);
270-
if (!g_apps) g_apps = new std::map<std::string, UniquePtr<AppData>>();
269+
if (!g_apps) {
270+
g_apps = new std::map<std::string, UniquePtr<AppData>>();
271+
created_first_app = true;
272+
}
271273
(*g_apps)[std::string(app->name())] = app_data;
272274
// Create a cleanup notifier for the app.
273275
{

0 commit comments

Comments
 (0)