diff options
author | Guy Harris <guy@alum.mit.edu> | 2015-01-30 18:12:51 -0800 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2015-01-31 02:14:05 +0000 |
commit | ee9d0f92307a13e288cfa966007b79ddfdb3e783 (patch) | |
tree | ecb6c3f2fbd1a4d8b51c888ed3b530f8e4c56695 /wireshark-qt.cpp | |
parent | a984dbf0174408ca776c288e6454f0695afabfaa (diff) |
This being C++, maybe we don't have to initialize ws_app until later.
Try going back to haveing ws_app be an automatic variable, but don't
declare it until after we've done the first-pass argument parsing.
Change-Id: Ia1f2a4819570bfadcba75d498e01dbe64991843c
Reviewed-on: https://code.wireshark.org/review/6867
Reviewed-by: Guy Harris <guy@alum.mit.edu>
Diffstat (limited to 'wireshark-qt.cpp')
-rw-r--r-- | wireshark-qt.cpp | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/wireshark-qt.cpp b/wireshark-qt.cpp index af6cbd489d..8aa16c2841 100644 --- a/wireshark-qt.cpp +++ b/wireshark-qt.cpp @@ -430,7 +430,6 @@ reset_library_path(void) /* And now our feature presentation... [ fade to music ] */ int main(int argc, char *argv[]) { - WiresharkApplication* ws_app; MainWindow *main_w; int opt; @@ -621,7 +620,7 @@ int main(int argc, char *argv[]) #endif /* Create The Wireshark app */ - ws_app = new WiresharkApplication(argc, argv); + WiresharkApplication ws_app(argc, argv); /* initialize the funnel mini-api */ // xxx qtshark @@ -745,7 +744,7 @@ int main(int argc, char *argv[]) main_w->show(); // We may not need a queued connection here but it would seem to make sense // to force the issue. - main_w->connect(ws_app, SIGNAL(openCaptureFile(QString&,QString&,unsigned int)), + main_w->connect(&ws_app, SIGNAL(openCaptureFile(QString&,QString&,unsigned int)), main_w, SLOT(openCaptureFile(QString&,QString&,unsigned int))); /* Init the "Open file" dialog directory */ @@ -836,7 +835,7 @@ int main(int argc, char *argv[]) splash_update(RA_PREFERENCES, NULL, NULL); - prefs_p = ws_app->readConfigurationFiles(&gdp_path, &dp_path); + prefs_p = ws_app.readConfigurationFiles(&gdp_path, &dp_path); /* * To reset the options parser, set optreset to 1 on platforms that |