reorder cursor / connection destruction

This commit is contained in:
Aaron
2009-05-19 11:03:30 -04:00
parent c1df2f1a5f
commit c19bc9f686

View File

@@ -39,14 +39,14 @@ namespace mongo {
class CursorHolder {
public:
CursorHolder( auto_ptr< DBClientCursor > &cursor, const shared_ptr< DBClientBase > &connection ) :
cursor_( cursor ),
connection_( connection ) {
connection_( connection ),
cursor_( cursor ) {
assert( cursor_.get() );
}
DBClientCursor *get() const { return cursor_.get(); }
private:
auto_ptr< DBClientCursor > cursor_;
shared_ptr< DBClientBase > connection_;
auto_ptr< DBClientCursor > cursor_;
};
DBClientCursor *getCursor( JSContext *cx, JSObject *obj ) {