Closed iwbnwif closed 8 years ago
well, I put that sample quickly and so its a bug. I will have a look into it, but also PR is appreciated
On the other hand if this is a bug, then perhaps it would be worth thinking about using some of the wxWidgets smart pointers here. Also for result sets because it would avoid having to close them each time, they would simply go out of focus and be deleted.
Thinking about this a bit more, for the examples it is probably unnecessary. Instead we can just declare the objects locally on the stack.
I still think a smart pointer (i.e. wxScopedPtr) typedef'd to something would be useful for things like transactions and possibly resultsets that can be passed around methods.
Thinking about this a bit more, for the examples it is probably unnecessary. Instead we can just declare the objects locally on the stack. Yeah that will be better, can you test that and make a PR? I currently work on adding ODBC support so I'm a bit tight (I work on "free time")
I still think a smart pointer (i.e. wxScopedPtr) typedef'd to something would be useful for things like transactions and possibly resultsets that can be passed around methods.
Can you open new Issue on specific things that you want me to add (eg transaction, explaining your solution)?
I will open until this bug is fixed (its simple .. but bug anyway ;))
Sorry, closed by accident!
I will look into a concrete scheme for this while I am working on the Firebird backend, so it may take some time.
:+1:
In the MySQL sample a new wxMysqlDatabase is instantiated at line 34, but isn't deleted.
This might be my understanding of the MySQL backend code, sorry for wasting time if so.
On the other hand if this is a bug, then perhaps it would be worth thinking about using some of the wxWidgets smart pointers here. Also for result sets because it would avoid having to close them each time, they would simply go out of focus and be deleted.