* Return object to pool * 将对象归还到池中 * * @param obj GObject to return | 要归还的 GObject
(obj: GObject)
| 62 | * @param obj GObject to return | 要归还的 GObject |
| 63 | */ |
| 64 | public returnObject(obj: GObject): void { |
| 65 | const url = obj.resourceURL; |
| 66 | if (!url) return; |
| 67 | |
| 68 | let arr = this._pool.get(url); |
| 69 | if (!arr) { |
| 70 | arr = []; |
| 71 | this._pool.set(url, arr); |
| 72 | } |
| 73 | |
| 74 | this._count++; |
| 75 | arr.push(obj); |
| 76 | } |
| 77 | } |
no test coverage detected