Skip to content

Commit 336f351

Browse files
committed
Remove dead code, fix a memory leak
1 parent 6a31ce6 commit 336f351

File tree

1 file changed

+3
-11
lines changed

1 file changed

+3
-11
lines changed

src/caja-application.c

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -301,17 +301,15 @@ open_tabs (CajaApplication *application,
301301
uri = g_file_get_uri (locations[0]);
302302
g_debug ("Opening new tab at uri %s\n", uri);
303303
caja_window_go_to (window, locations[0]);
304+
g_free (uri);
304305
for (int i = 1; i< n_files;i++) {
305306
/* open tabs in reverse order because each
306307
* tab is opened before the previous one */
307308
guint tab = n_files-i;
308309
uri = g_file_get_uri (locations[tab]);
309310
g_debug ("Opening new tab at uri %s\n", uri);
310-
if (i == 0) {
311-
caja_window_go_to (window, locations[tab]);
312-
} else {
313-
caja_window_go_to_tab (window, locations[tab]);
314-
}
311+
caja_window_go_to_tab (window, locations[tab]);
312+
g_free (uri);
315313
}
316314

317315
if (geometry != NULL && !gtk_widget_get_visible (GTK_WIDGET (window))) {
@@ -324,8 +322,6 @@ open_tabs (CajaApplication *application,
324322
APPLICATION_WINDOW_MIN_HEIGHT,
325323
FALSE);
326324
}
327-
328-
g_free (uri);
329325
}
330326

331327
static void
@@ -2225,10 +2221,6 @@ caja_application_local_command_line (GApplication *application,
22252221
}
22262222
g_application_open (application, files, len, concatOptions);
22272223
g_free (concatOptions);
2228-
} else {
2229-
if (len > 0) {
2230-
g_application_open (application, files, len, "");
2231-
}
22322224
}
22332225

22342226
for (idx = 0; idx < len; idx++) {

0 commit comments

Comments
 (0)