forked from RestKit/RestKit
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixing crash from over-release of RKParams.
- Loading branch information
1 parent
a78b4c6
commit 72f2669
Showing
5 changed files
with
57 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
// | ||
// RKParamsSpec.m | ||
// RestKit | ||
// | ||
// Created by Blake Watters on 6/30/11. | ||
// Copyright 2011 Two Toasters. All rights reserved. | ||
// | ||
|
||
#import "RKSpecEnvironment.h" | ||
#import "RKParams.h" | ||
#import "RKRequest.h" | ||
|
||
@interface RKParamsSpec : RKSpec | ||
|
||
@end | ||
|
||
@implementation RKParamsSpec | ||
|
||
- (void)itShouldNotOverReleaseTheParams { | ||
RKLogConfigureByName("RestKit/Network*", RKLogLevelTrace); | ||
NSDictionary* dictionary = [NSDictionary dictionaryWithObject:@"foo" forKey:@"bar"]; | ||
RKParams* params = [[RKParams alloc] initWithDictionary:dictionary]; | ||
NSURL* URL = [NSURL URLWithString:[RKSpecGetBaseURL() stringByAppendingFormat:@"/echo_params"]]; | ||
RKSpecResponseLoader* responseLoader = [RKSpecResponseLoader responseLoader]; | ||
RKRequest* request = [[RKRequest alloc] initWithURL:URL]; | ||
request.method = RKRequestMethodPOST; | ||
request.params = params; | ||
request.delegate = responseLoader; | ||
[request sendAsynchronously]; | ||
[responseLoader waitForResponse]; | ||
[request release]; | ||
} | ||
|
||
@end |