forked from lda/telodendria
Fix memory leak in DbDelete()
This commit is contained in:
parent
1a43ea6470
commit
fbd7bf5944
3 changed files with 12 additions and 7 deletions
|
@ -1,4 +1,4 @@
|
||||||
.Dd $Mdocdate: December 24 2022 $
|
.Dd $Mdocdate: December 28 2022 $
|
||||||
.Dt TELODENDRIA-CHANGELOG 7
|
.Dt TELODENDRIA-CHANGELOG 7
|
||||||
.Os Telodendria Project
|
.Os Telodendria Project
|
||||||
.Sh NAME
|
.Sh NAME
|
||||||
|
@ -101,6 +101,9 @@ safer ones.
|
||||||
.It
|
.It
|
||||||
Fixed a memory leak that would occur when closing a
|
Fixed a memory leak that would occur when closing a
|
||||||
database that contains cached objects.
|
database that contains cached objects.
|
||||||
|
.It
|
||||||
|
Fixed a memory leak that would occur when deleting database
|
||||||
|
objects.
|
||||||
.El
|
.El
|
||||||
.Pp
|
.Pp
|
||||||
Misc:
|
Misc:
|
||||||
|
|
|
@ -111,9 +111,9 @@ CronThread(void *args)
|
||||||
const unsigned long microTick = 100;
|
const unsigned long microTick = 100;
|
||||||
unsigned long remainingTick = cron->tick - (te - ts);
|
unsigned long remainingTick = cron->tick - (te - ts);
|
||||||
|
|
||||||
/* Only sleep for microTick ms at a time because if the
|
/* Only sleep for microTick ms at a time because if the job
|
||||||
* job scheduler is supposed to stop before the tick is up,
|
* scheduler is supposed to stop before the tick is up, we
|
||||||
* we don't want to be stuck in a long sleep */
|
* don't want to be stuck in a long sleep */
|
||||||
while (remainingTick >= microTick && !cron->stop)
|
while (remainingTick >= microTick && !cron->stop)
|
||||||
{
|
{
|
||||||
UtilSleepMillis(microTick);
|
UtilSleepMillis(microTick);
|
||||||
|
|
2
src/Db.c
2
src/Db.c
|
@ -662,6 +662,8 @@ DbDelete(Db * db, size_t nArgs,...)
|
||||||
|
|
||||||
pthread_mutex_unlock(&db->lock);
|
pthread_mutex_unlock(&db->lock);
|
||||||
|
|
||||||
|
ArrayFree(args);
|
||||||
|
Free(file);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue