projects
/
NeonServV5.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
57e7d4b
)
fixed crash caused by startup reload event
author
pk910
<philipp@zoelle1.de>
Mon, 27 Aug 2012 04:25:44 +0000
(06:25 +0200)
committer
pk910
<philipp@zoelle1.de>
Mon, 27 Aug 2012 04:25:44 +0000
(06:25 +0200)
src/IRCEvents.c
patch
|
blob
|
history
src/main.c
patch
|
blob
|
history
diff --git
a/src/IRCEvents.c
b/src/IRCEvents.c
index b4eba22e0fcf2eab39747cd18796bc9c81c2890a..a2b7717c7488e7cd9e9909fcd145ee34d06d47dc 100644
(file)
--- a/
src/IRCEvents.c
+++ b/
src/IRCEvents.c
@@
-28,7
+28,7
@@
struct binding {
struct binding *next;
};
struct binding *next;
};
-static void **binds;
+static void **binds
= NULL
;
#define BIND_TYPE_JOIN 0
#define BIND_TYPE_NICK 1
#define BIND_TYPE_PART 2
#define BIND_TYPE_JOIN 0
#define BIND_TYPE_NICK 1
#define BIND_TYPE_PART 2
@@
-53,6
+53,8
@@
static void **binds;
#define TOTAL_BIND_TYPES 20
void init_bind() {
#define TOTAL_BIND_TYPES 20
void init_bind() {
+ if(binds)
+ return;
binds = calloc(TOTAL_BIND_TYPES, sizeof(*binds));
}
binds = calloc(TOTAL_BIND_TYPES, sizeof(*binds));
}
@@
-66,6
+68,7
@@
void free_bind() {
}
}
free(binds);
}
}
free(binds);
+ binds = NULL;
}
void unregister_module_events(int module_id) {
}
void unregister_module_events(int module_id) {
@@
-225,4
+228,4
@@
FUNC_EVENT(freechan, freechan_func_t, BIND_TYPE_FREECHAN, (struct ChanNode *chan
FUNC_BIND(reload, reload_func_t, BIND_TYPE_RELOAD)
FUNC_UNBIND(reload, reload_func_t, BIND_TYPE_RELOAD)
FUNC_BIND(reload, reload_func_t, BIND_TYPE_RELOAD)
FUNC_UNBIND(reload, reload_func_t, BIND_TYPE_RELOAD)
-FUNC_EVENT(reload, reload_func_t, BIND_TYPE_RELOAD, (int initialization), (initialization))
\ No newline at end of file
+FUNC_EVENT(reload, reload_func_t, BIND_TYPE_RELOAD, (int initialization), (initialization))
diff --git
a/src/main.c
b/src/main.c
index 3bef6eeb08ca917c821ae6240b5c4c2d5e254264..17b8258c5110fd17760cce6313f4d5a2154d11d8 100644
(file)
--- a/
src/main.c
+++ b/
src/main.c
@@
-209,6
+209,7
@@
int main(int argc, char *argv[]) {
fprintf(stderr, "Unable to load " CONF_FILE "\n");
exit(0);
}
fprintf(stderr, "Unable to load " CONF_FILE "\n");
exit(0);
}
+ init_bind();
event_reload(1);
#if HAVE_THREADS
THREAD_MUTEX_INIT(log_sync);
event_reload(1);
#if HAVE_THREADS
THREAD_MUTEX_INIT(log_sync);