Bug Report #4287
Validation memory leak
| Status: | Assigned | Start date: | 09/29/2011 | |
|---|---|---|---|---|
| Priority: | Normal | Due date: | ||
| Assignee: | % Done: | 0% |
||
| Category: | Core | |||
| Target version: | v3.1.5 | |||
| Resolution: | Points: | 1 |
Description
This issue is related to #4286 (can be reproduced by code in that issue), but not duplicate it. There is another memory leak in Validation: in check() the Validation object binds to ":validation" property, so recursion link appears. Quick fix: unsetting this binding:
Index: classes/kohana/validation.php
===================================================================
--- classes/kohana/validation.php (revision 58)
+++ classes/kohana/validation.php (working copy)
@@ -415,6 +415,9 @@
// Restore the data to its original form
$this->_data = $original;
+ // To prevent memory leaks
+ unset($this->_bound[':validation']);
+
if (isset($benchmark))
{
// Stop benchmarking
I dont know, may be this fix will cause errors in some other place, so it must be tested
Related issues
History
Updated by Isaiah DeRose-Wilson 6 months ago
- Category set to Core
- Status changed from New to Assigned
- Assignee set to Isaiah DeRose-Wilson
- Target version set to v3.1.5