aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJeffrey Stedfast <fejj@ximian.com>2002-06-04 06:40:05 +0800
committerJeffrey Stedfast <fejj@src.gnome.org>2002-06-04 06:40:05 +0800
commitd2f3c35bbf052985672788cff36452bd357c8b24 (patch)
treea925de40789e565fc29d693c75ad3adac6218e6c
parent17bd1b5a45d0236fe8e409450928c3b969cb3978 (diff)
downloadgsoc2013-evolution-d2f3c35bbf052985672788cff36452bd357c8b24.tar
gsoc2013-evolution-d2f3c35bbf052985672788cff36452bd357c8b24.tar.gz
gsoc2013-evolution-d2f3c35bbf052985672788cff36452bd357c8b24.tar.bz2
gsoc2013-evolution-d2f3c35bbf052985672788cff36452bd357c8b24.tar.lz
gsoc2013-evolution-d2f3c35bbf052985672788cff36452bd357c8b24.tar.xz
gsoc2013-evolution-d2f3c35bbf052985672788cff36452bd357c8b24.tar.zst
gsoc2013-evolution-d2f3c35bbf052985672788cff36452bd357c8b24.zip
Allocate a new FileInfo struct here rather than using and unref it when
2002-06-03 Jeffrey Stedfast <fejj@ximian.com> * e-msg-composer.c (e_msg_composer_guess_mime_type): Allocate a new FileInfo struct here rather than using and unref it when we're finished with it. svn path=/trunk/; revision=17090
-rw-r--r--composer/ChangeLog6
-rw-r--r--composer/e-msg-composer.c19
2 files changed, 14 insertions, 11 deletions
diff --git a/composer/ChangeLog b/composer/ChangeLog
index 2b44ab0f2e..37aa3dc2de 100644
--- a/composer/ChangeLog
+++ b/composer/ChangeLog
@@ -1,8 +1,8 @@
2002-06-03 Jeffrey Stedfast <fejj@ximian.com>
- * e-msg-composer.c (e_msg_composer_guess_mime_type): Use
- gnome_vfs_file_info_clear() instead of gnome_vfs_file_info_unref()
- so that we don't try and free static data.
+ * e-msg-composer.c (e_msg_composer_guess_mime_type): Allocate a
+ new FileInfo struct here rather than using and unref it when we're
+ finished with it.
2002-05-30 Not Zed <NotZed@Ximian.com>
diff --git a/composer/e-msg-composer.c b/composer/e-msg-composer.c
index 6966bee83c..4524efe7f2 100644
--- a/composer/e-msg-composer.c
+++ b/composer/e-msg-composer.c
@@ -1350,7 +1350,7 @@ do_exit (EMsgComposer *composer)
gnome_dialog_set_parent (GNOME_DIALOG (dialog), GTK_WINDOW (composer));
gnome_dialog_set_default (GNOME_DIALOG (dialog), 0);
button = gnome_dialog_run_and_close (GNOME_DIALOG (dialog));
-
+
switch (button) {
case 0: /* Save */
gtk_signal_emit (GTK_OBJECT (composer), signals[SAVE_DRAFT], TRUE);
@@ -4214,20 +4214,23 @@ e_msg_composer_get_view_replyto (EMsgComposer *composer)
gchar *
e_msg_composer_guess_mime_type (const gchar *file_name)
{
- GnomeVFSFileInfo info;
+ GnomeVFSFileInfo *info;
GnomeVFSResult result;
-
- result = gnome_vfs_get_file_info (file_name, &info,
+
+ info = gnome_vfs_file_info_new ();
+ result = gnome_vfs_get_file_info (file_name, info,
GNOME_VFS_FILE_INFO_GET_MIME_TYPE |
GNOME_VFS_FILE_INFO_FOLLOW_LINKS);
if (result == GNOME_VFS_OK) {
gchar *type;
-
- type = g_strdup (gnome_vfs_file_info_get_mime_type (&info));
- gnome_vfs_file_info_clear (&info);
+
+ type = g_strdup (gnome_vfs_file_info_get_mime_type (info));
+ gnome_vfs_file_info_unref (info);
return type;
- } else
+ } else {
+ gnome_vfs_file_info_unref (info);
return NULL;
+ }
}
/**