mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-08-14 10:01:08 +08:00
fix: class name typo (#10364)
This commit is contained in:

committed by
GitHub

parent
fc172b3ea8
commit
f5f4666e04
@ -13,19 +13,19 @@ function ensureHttpRequest() {
|
||||
}
|
||||
|
||||
@NativeClass
|
||||
class MemmoryWarningHandler extends NSObject {
|
||||
static new(): MemmoryWarningHandler {
|
||||
return <MemmoryWarningHandler>super.new();
|
||||
class MemoryWarningHandler extends NSObject {
|
||||
static new(): MemoryWarningHandler {
|
||||
return <MemoryWarningHandler>super.new();
|
||||
}
|
||||
|
||||
private _cache: NSCache<any, any>;
|
||||
|
||||
public initWithCache(cache: NSCache<any, any>): MemmoryWarningHandler {
|
||||
public initWithCache(cache: NSCache<any, any>): MemoryWarningHandler {
|
||||
this._cache = cache;
|
||||
|
||||
NSNotificationCenter.defaultCenter.addObserverSelectorNameObject(this, 'clearCache', 'UIApplicationDidReceiveMemoryWarningNotification', null);
|
||||
if (Trace.isEnabled()) {
|
||||
Trace.write('[MemmoryWarningHandler] Added low memory observer.', Trace.categories.Debug);
|
||||
Trace.write('[MemoryWarningHandler] Added low memory observer.', Trace.categories.Debug);
|
||||
}
|
||||
|
||||
return this;
|
||||
@ -34,14 +34,14 @@ class MemmoryWarningHandler extends NSObject {
|
||||
public dealloc(): void {
|
||||
NSNotificationCenter.defaultCenter.removeObserverNameObject(this, 'UIApplicationDidReceiveMemoryWarningNotification', null);
|
||||
if (Trace.isEnabled()) {
|
||||
Trace.write('[MemmoryWarningHandler] Removed low memory observer.', Trace.categories.Debug);
|
||||
Trace.write('[MemoryWarningHandler] Removed low memory observer.', Trace.categories.Debug);
|
||||
}
|
||||
super.dealloc();
|
||||
}
|
||||
|
||||
public clearCache(): void {
|
||||
if (Trace.isEnabled()) {
|
||||
Trace.write('[MemmoryWarningHandler] Clearing Image Cache.', Trace.categories.Debug);
|
||||
Trace.write('[MemoryWarningHandler] Clearing Image Cache.', Trace.categories.Debug);
|
||||
}
|
||||
this._cache.removeAllObjects();
|
||||
utils.GC();
|
||||
@ -56,14 +56,14 @@ export class Cache extends common.Cache {
|
||||
private _cache: NSCache<any, any>;
|
||||
|
||||
//@ts-ignore
|
||||
private _memoryWarningHandler: MemmoryWarningHandler;
|
||||
private _memoryWarningHandler: MemoryWarningHandler;
|
||||
|
||||
constructor() {
|
||||
super();
|
||||
|
||||
this._cache = new NSCache<any, any>();
|
||||
|
||||
this._memoryWarningHandler = MemmoryWarningHandler.new().initWithCache(this._cache);
|
||||
this._memoryWarningHandler = MemoryWarningHandler.new().initWithCache(this._cache);
|
||||
}
|
||||
|
||||
public _downloadCore(request: common.DownloadRequest) {
|
||||
|
Reference in New Issue
Block a user