Skip to content

Commit

Permalink
fix MockObject.default_mock_factory()
Browse files Browse the repository at this point in the history
  • Loading branch information
Whiteknight committed Sep 11, 2011
1 parent 28a8b91 commit bdf6461
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions src/mockobject/MockObject.winxed
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,14 @@ namespace Rosella
function default_mock_factory()
{
var temp = Rosella.Globals.get_global(DEFAULT_MOCK_FACTORY_KEY);
if (temp == null)
Rosella.Globals.register_global(DEFAULT_MOCK_FACTORY_KEY, new Rosella.MockObject.Factory());
yield temp;
while(1)
if (temp == null) {
temp = new Rosella.MockObject.Factory();
Rosella.Globals.register_global(DEFAULT_MOCK_FACTORY_KEY, temp);
}
while(1) {
yield temp;
temp = Rosella.Globals.get_global(DEFAULT_MOCK_FACTORY_KEY);
}
}

// Set a new MockObject instance in the global instance registry.
Expand Down

0 comments on commit bdf6461

Please sign in to comment.