Page MenuHomePhabricator

D12841.id.diff
No OneTemporary

D12841.id.diff

diff --git a/src/aphront/writeguard/AphrontWriteGuard.php b/src/aphront/writeguard/AphrontWriteGuard.php
--- a/src/aphront/writeguard/AphrontWriteGuard.php
+++ b/src/aphront/writeguard/AphrontWriteGuard.php
@@ -36,6 +36,7 @@
private $callback;
private $allowDepth = 0;
+ private $disposed;
/* -( Managing Write Guards )---------------------------------------------- */
@@ -109,6 +110,7 @@
'beginUnguardedWrites()',
'endUnguardedWrites()'));
}
+ $this->disposed = true;
self::$instance = null;
}
@@ -119,6 +121,7 @@
* @return void
*/
public function disposeAbruptly() {
+ $this->disposed = true;
self::$instance = null;
}
@@ -290,7 +293,7 @@
* @task internal
*/
public function __destruct() {
- if (isset(self::$instance)) {
+ if (!$this->disposed) {
throw new Exception(
pht(
'%s was not properly disposed of! Call %s on every %s object you '.

File Metadata

Mime Type
text/plain
Expires
Mon, Oct 21, 11:09 AM (4 w, 9 h ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6727642
Default Alt Text
D12841.id.diff (969 B)

Event Timeline