List:MySQL++« Previous MessageNext Message »
From:Paul Martin Date:April 7 2006 10:33pm
Subject:Re: Re: Destroying Query object causes unhandled exception
View as plain text  
I am having the same problem as below... I can use my
app in Debug mode no problem, but when I build Release
I get the error below.  

His solution didn't work for me... plus that is just a
workaround in my opinion.  I think possibly there is a
problem in the MySql++ code?  I was using 1.7 with
MySql 4.1.x before and didn't see this error, its only
with 2.1 and MySql 5.0.x that it's reared its ugly
head.

Any ideas would be most welcome... for now I guess I
can release the debug version only.

Paul


On Fri, Oct 14, 2005 at 05:20:06PM +0200, Stromek
wrote:
> Hello all,
> 
> right to the point. I have the following code in my
application:
> 
> try
> {
> 	mysqlpp::Connection sqlCon( db, host, user, passwd
);
> 
> 	mysqlpp::Query query = sqlCon.query( );
> }
> catch ( const mysqlpp::BadQuery &e )
> {
> 	cerr << e.what( ) << endl;
> 	return;
> }
> catch ( const mysqlpp::Exception &e )
> {
> 	cerr << e.what( ) << endl;
> 	return;
> }
> 
> With this code it is possible to use the connection
and the query object to
> manipulate database.
> But when the application is going out of the try
block and tries to destroy Query
> object it stops in "dbgheap.c" with unhandled
exception or assert says:
> 
> Expression: _BLOCK_TYPE_IS_VALIDE(pHead->nBlockUse)
> 
> I have found this type of error on google but
without any replyes. I've
> been playing more with this code and tried to set up
new project. In new
> project it is without error.
> 
> Therefore I thought, I have problem with memory
leaks. But it was
> strange because the application runs without any
error. So I've commented
> everything before that try block but it haven't
helped.
> 
> Does anybody have any idea what might be the
problem? Thanks in advance!

Well, maybe I'm lucky man :-) but I have found one
solution. Examples
from MySQL++ also worked so I bet it must be error of
the stupid
microsoft VC++. I played with project settings of the
example containing
only code above. I've created application but Runtime
Library settings
in Code Generation part were set to Multi-threaded
Debug DLL. I set it
to Multi-threaded DLL and the same error from my
application appeared.
So I have changed my application settings and it
surprisingly works.

So my solution is, use /MDd (Multi-threaded Debug DLL)
switch with
VC7.1 and have a nice day, lol.


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 
Thread
Re: Re: Destroying Query object causes unhandled exceptionPaul Martin8 Apr
  • Re: Destroying Query object causes unhandled exceptionWarren Young8 Apr