mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-01-26 22:16:16 +01:00
Shut down fam (including removing fam GSource) when module is unloaded
2008-03-14 Alexander Larsson <alexl@redhat.com> * fam/fam-helper.[ch]: * fam/fam-module.c: Shut down fam (including removing fam GSource) when module is unloaded (#521513) Patch from Joe Marcus Clarke svn path=/trunk/; revision=6706
This commit is contained in:
parent
9555a3a2ca
commit
6fc66109a0
@ -1,3 +1,11 @@
|
||||
2008-03-14 Alexander Larsson <alexl@redhat.com>
|
||||
|
||||
* fam/fam-helper.[ch]:
|
||||
* fam/fam-module.c:
|
||||
Shut down fam (including removing fam GSource) when
|
||||
module is unloaded (#521513)
|
||||
Patch from Joe Marcus Clarke
|
||||
|
||||
2008-03-14 Alexander Larsson <alexl@redhat.com>
|
||||
|
||||
* giomodule.c:
|
||||
|
@ -181,6 +181,22 @@ _fam_sub_startup (void)
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
void
|
||||
_fam_sub_shutdown (void)
|
||||
{
|
||||
G_LOCK (fam_connection);
|
||||
|
||||
if (fam_connection != NULL) {
|
||||
FAMClose (fam_connection);
|
||||
g_free (fam_connection);
|
||||
g_source_remove (fam_watch_id);
|
||||
fam_watch_id = 0;
|
||||
fam_connection = NULL;
|
||||
}
|
||||
|
||||
G_UNLOCK (fam_connection);
|
||||
}
|
||||
|
||||
fam_sub*
|
||||
_fam_sub_add (const gchar* pathname,
|
||||
gboolean directory,
|
||||
|
@ -28,6 +28,7 @@
|
||||
typedef struct _fam_sub fam_sub;
|
||||
|
||||
gboolean _fam_sub_startup (void);
|
||||
void _fam_sub_shutdown (void);
|
||||
fam_sub* _fam_sub_add (const gchar* pathname,
|
||||
gboolean directory,
|
||||
gpointer user_data);
|
||||
|
@ -26,6 +26,7 @@
|
||||
#include "giomodule.h"
|
||||
#include "gfamdirectorymonitor.h"
|
||||
#include "gfamfilemonitor.h"
|
||||
#include "fam-helper.h"
|
||||
|
||||
void
|
||||
g_io_module_load (GIOModule *module)
|
||||
@ -37,5 +38,6 @@ g_io_module_load (GIOModule *module)
|
||||
void
|
||||
g_io_module_unload (GIOModule *module)
|
||||
{
|
||||
_fam_sub_shutdown ();
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user