-
Notifications
You must be signed in to change notification settings - Fork 54
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix DBConfig used in builder #177
Conversation
include/libjungle/jungle_builder.h
Outdated
/** | ||
* DBConfig for the DB instance to be created. | ||
*/ | ||
const DBConfig* dbConfig; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It should be DBConfig dbConfig
, not pointer. The caller (of init
) life span may not be longer than builder's life span.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In the init() function, https://github.com/eBay/Jungle/pull/177/files#diff-e81fa7970a0833b1cb0b4bdbfadfefa84eaee52400bbf5d0b49d47bbe5474e63R121-R124
We already copy the passed in db_config to the dbConfig member of Builder
, the pointer in this BuildParams
will have the same life span as Builder
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, now I get it.
include/libjungle/jungle_builder.h
Outdated
/** | ||
* DBConfig for the DB instance to be created. | ||
*/ | ||
const DBConfig* dbConfig; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, now I get it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wait, dbConfig
should be initialized to null.
I change it from pointer to regular object so that BuilderParams will have a default db config. |
No description provided.