summaryrefslogtreecommitdiffstats
path: root/src/inkscape.cpp
diff options
context:
space:
mode:
authorPatrick Storz <eduard.braun2@gmx.de>2019-06-07 22:27:29 +0000
committerPatrick Storz <eduard.braun2@gmx.de>2019-06-07 22:28:13 +0000
commit96c7da471a5a3c771714f78db87c357873d64816 (patch)
tree01210fd886781d10d7598f82674c4c5da65d8576 /src/inkscape.cpp
parentTextToolbar: Fix superscript/subscript handling (diff)
downloadinkscape-96c7da471a5a3c771714f78db87c357873d64816.tar.gz
inkscape-96c7da471a5a3c771714f78db87c357873d64816.zip
Remove _argv0 from Inkscape::Application
Currently it was only used as the least preferred (and therefore effectively unused) location where to store the crash backup. However it wasn't set properly since 408cb49b5559a81ea803df64bf58457a5dd4bf16 causing assertion errors while crashing. On top of that argv0 is not a reliable way to determine the path to the currently running executable anyway. Fixes https://gitlab.com/inkscape/inkscape/issues/176
Diffstat (limited to 'src/inkscape.cpp')
-rw-r--r--src/inkscape.cpp21
1 files changed, 3 insertions, 18 deletions
diff --git a/src/inkscape.cpp b/src/inkscape.cpp
index 72ca329ab..984bccf6d 100644
--- a/src/inkscape.cpp
+++ b/src/inkscape.cpp
@@ -161,10 +161,10 @@ Application::operator &() const
* Creates a new Inkscape::Application global object.
*/
void
-Application::create(const char *argv0, bool use_gui)
+Application::create(bool use_gui)
{
if (!Application::exists()) {
- new Application(argv0, use_gui);
+ new Application(use_gui);
} else {
// g_assert_not_reached(); Can happen with InkscapeApplication
}
@@ -361,11 +361,6 @@ void Application::autosave_init()
}
}
-void Application::argv0(char const* argv)
-{
- _argv0 = g_strdup(argv);
-}
-
/**
* \brief Add our CSS style sheets
*/
@@ -489,7 +484,7 @@ Application::add_gtk_css()
* \pre Application::_S_inst == NULL
*/
-Application::Application(const char* argv, bool use_gui) :
+Application::Application(bool use_gui) :
_menus(nullptr),
_desktops(nullptr),
refCount(1),
@@ -509,8 +504,6 @@ Application::Application(const char* argv, bool use_gui) :
bus_handler = signal (SIGBUS, Application::crash_handler);
#endif
- _argv0 = g_strdup(argv);
-
// \TODO: this belongs to Application::init but if it isn't here
// then the Filters and Extensions menus don't work.
_S_inst = this;
@@ -603,11 +596,6 @@ Application::~Application()
_menus = nullptr;
}
- if (_argv0) {
- g_free(_argv0);
- _argv0 = nullptr;
- }
-
_S_inst = nullptr; // this will probably break things
refCount = 0;
@@ -668,7 +656,6 @@ Application::crash_handler (int /*signum*/)
gint count = 0;
gchar *curdir = g_get_current_dir(); // This one needs to be freed explicitly
- gchar *inkscapedir = g_path_get_dirname(INKSCAPE._argv0); // Needs to be freed
std::vector<gchar *> savednames;
std::vector<gchar *> failednames;
for (std::map<SPDocument*,int>::iterator iter = INKSCAPE._document_set.begin(), e = INKSCAPE._document_set.end();
@@ -714,7 +701,6 @@ Application::crash_handler (int /*signum*/)
g_get_home_dir(),
g_get_tmp_dir(),
curdir,
- inkscapedir
};
FILE *file = nullptr;
for(auto & location : locations) {
@@ -740,7 +726,6 @@ Application::crash_handler (int /*signum*/)
}
}
g_free(curdir);
- g_free(inkscapedir);
if (!savednames.empty()) {
fprintf (stderr, "\nEmergency save document locations:\n");