summaryrefslogtreecommitdiff
path: root/mysys
diff options
context:
space:
mode:
Diffstat (limited to 'mysys')
-rw-r--r--mysys/array.c3
-rw-r--r--mysys/my_init.c8
-rw-r--r--mysys/my_thr_init.c3
3 files changed, 5 insertions, 9 deletions
diff --git a/mysys/array.c b/mysys/array.c
index 164e62bd9f9..83a879768c4 100644
--- a/mysys/array.c
+++ b/mysys/array.c
@@ -61,7 +61,8 @@ my_bool init_dynamic_array2(DYNAMIC_ARRAY *array, uint element_size,
Since the dynamic array is usable even if allocation fails here malloc
should not throw an error
*/
- if (!(array->buffer= (uchar*) my_malloc(element_size*init_alloc, MYF(0))))
+ if (init_alloc &&
+ !(array->buffer= (uchar*) my_malloc(element_size*init_alloc, MYF(0))))
array->max_element=0;
DBUG_RETURN(FALSE);
}
diff --git a/mysys/my_init.c b/mysys/my_init.c
index 8cf1af2f8ee..b8398465e74 100644
--- a/mysys/my_init.c
+++ b/mysys/my_init.c
@@ -201,11 +201,6 @@ Voluntary context switches %ld, Involuntary context switches %ld\n",
#endif
}
- if (!(infoflag & MY_DONT_FREE_DBUG))
- {
- DBUG_END(); /* Must be done before my_thread_end */
- }
-
my_thread_end();
my_thread_global_end();
my_mutex_end();
@@ -223,6 +218,9 @@ Voluntary context switches %ld, Involuntary context switches %ld\n",
WSACleanup();
#endif /* __WIN__ */
+ if (!(infoflag & MY_DONT_FREE_DBUG))
+ DBUG_END(); /* Must be done as late as possible */
+
my_init_done=0;
} /* my_end */
diff --git a/mysys/my_thr_init.c b/mysys/my_thr_init.c
index 36f86bf99ce..41f9cdf99ed 100644
--- a/mysys/my_thr_init.c
+++ b/mysys/my_thr_init.c
@@ -366,10 +366,7 @@ void my_thread_end(void)
tmp->dbug=0;
}
#endif
-#if !defined(__bsdi__) && !defined(__OpenBSD__)
- /* bsdi and openbsd 3.5 dumps core here */
mysql_cond_destroy(&tmp->suspend);
-#endif
mysql_mutex_destroy(&tmp->mutex);
/*