CLOUD: Add complex callbacks
Originally, I intended to add Storage API, StorageFile and StorageInfo stubs. When I tried to implement a simple info() call, I ended up fixing Request to contain some pointer field and all callbacks to have Request* parameter. And, now I have to place callback pointer into Request. which calls another callback. And, eventually, these "simple" callbacks would again require another pointer (to some caller class).
This commit is contained in:
parent
f913675c43
commit
17eb5f9143
8 changed files with 149 additions and 33 deletions
|
@ -75,7 +75,7 @@ bool CurlJsonRequest::handle() {
|
|||
if (_callback) {
|
||||
char *contents = getPreparedContents();
|
||||
Common::JSONValue *json = Common::JSON::parse(contents);
|
||||
_callback(json); //potential memory leak, free it in your callbacks!
|
||||
_callback(this, json); //potential memory leak, free it in your callbacks!
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue