Permalink
Browse files

fixed a few memory leaks

  • Loading branch information...
1 parent 86bb120 commit 00fcfdeee02d52c8d3979bbb79bfb9df89ed038f @kraih committed Feb 26, 2013
Showing with 6 additions and 3 deletions.
  1. +2 −1 Changes
  2. +3 −1 lib/Mango.pm
  3. +1 −1 lib/Mango/BSON.pm
View
@@ -1,5 +1,5 @@
-0.05 2013-02-23
+0.05 2013-02-26
- Added drop_index, index_information and stats methods to
Mango::Collection.
- Added eval and stats methods to Mango::Database.
@@ -8,6 +8,7 @@
- Improved exception handling for commands.
- Improved documentation.
- Improved tests.
+ - Fixed a few memory leaks.
0.04 2013-02-10
- Added collection_names method to Mango::Database.
View
@@ -93,7 +93,9 @@ sub new {
sub db {
my ($self, $name) = @_;
$name //= $self->default_db;
- return Mango::Database->new(mango => $self, name => $name);
+ my $db = Mango::Database->new(mango => $self, name => $name);
+ weaken $db->{mango};
+ return $db;
}
sub is_active { !!(scalar @{$_[0]{queue} || []} || $_[0]{current}) }
View
@@ -1,9 +1,9 @@
package Mango::BSON;
use Mojo::Base -strict;
-use Carp 'croak';
use re 'regexp_pattern';
use B;
+use Carp 'croak';
use Exporter 'import';
use Mango::BSON::Binary;
use Mango::BSON::Code;

0 comments on commit 00fcfde

Please sign in to comment.