2020-11-29 12:57:11 -05:00
|
|
|
#include "JSystem/JKernel/JKRDisposer/JKRDisposer.h"
|
|
|
|
|
#include "JSystem/JKernel/JKRHeap/JKRHeap.h"
|
2020-12-26 11:31:49 -05:00
|
|
|
#include "global.h"
|
2020-11-29 11:53:10 -05:00
|
|
|
|
2020-12-04 03:02:41 +01:00
|
|
|
JKRDisposer::JKRDisposer() : mLink(this) {
|
2021-01-04 03:26:25 +01:00
|
|
|
mHeap = JKRHeap::findFromRoot(this);
|
|
|
|
|
if (mHeap) {
|
|
|
|
|
mHeap->appendDisposer(this);
|
2020-11-29 11:53:10 -05:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
JKRDisposer::~JKRDisposer() {
|
2021-01-04 03:26:25 +01:00
|
|
|
JKRHeap* heap = mHeap;
|
2020-12-04 03:02:41 +01:00
|
|
|
if (heap) {
|
|
|
|
|
heap->removeDisposer(this);
|
|
|
|
|
}
|
2020-11-29 11:53:10 -05:00
|
|
|
}
|