g_object_get() makes a copy of strings that it returns, so every call
for "filename" was returning a copied string that the caller did not
free.
static void
save_file (PsppireWindow *w)
{
static void
save_file (PsppireWindow *w)
{
+ const gchar *file_name = NULL;
gchar *utf8_file_name = NULL;
gchar *utf8_file_name = NULL;
- gchar *file_name = NULL;
GString *fnx;
struct string filename ;
PsppireDataWindow *de = PSPPIRE_DATA_WINDOW (w);
gchar *syntax;
GString *fnx;
struct string filename ;
PsppireDataWindow *de = PSPPIRE_DATA_WINDOW (w);
gchar *syntax;
- g_object_get (w, "filename", &file_name, NULL);
+ file_name = psppire_window_get_filename (w);
fnx = g_string_new (file_name);
fnx = g_string_new (file_name);
const gchar *
psppire_window_get_filename (PsppireWindow *w)
{
const gchar *
psppire_window_get_filename (PsppireWindow *w)
{
- const gchar *name = NULL;
- g_object_get (w, "filename", &name, NULL);
- return name;