Skip to content

Commit

Permalink
DGraph: Fix dll boundary prob using qPrintable() instead of toStdStri…
Browse files Browse the repository at this point in the history
…ng()

The following page provides more details regarding dll boundary problem
which could appear when for example a debug executable is linked
against a release library and when memory allocated in one is freed in
the other.

See http://stackoverflow.com/questions/1227653/linking-against-library-in-release-and-exe-in-debug-crashes-in-visual-studio
  • Loading branch information
jcfr committed Nov 11, 2010
1 parent ca20ef9 commit fda766e
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions Utilities/DGraph/DGraph.cpp
Expand Up @@ -42,9 +42,9 @@ QString help(const QString& progName)
//----------------------------------------------------------------------------
void displayError(const QString& progName, const QString& msg)
{
std::cerr << QString("%1\n%2\n%3\n").arg(progName).
arg(msg).
arg(help(progName)).toStdString();
std::cerr << qPrintable(QString("%1\n%2\n%3\n").arg(progName).
arg(msg).
arg(help(progName)));
}

//----------------------------------------------------------------------------
Expand Down Expand Up @@ -222,7 +222,7 @@ int main(int argc, char** argv)

for(int i = 0; i < path.size(); ++i)
{
std::cerr << vertexIdToLabel[path[i]].toStdString();
std::cerr << qPrintable(vertexIdToLabel[path[i]]);
if (i != path.size() - 1)
{
std::cerr << " -> ";
Expand All @@ -235,7 +235,7 @@ int main(int argc, char** argv)

for(int i = 0; i < path.size(); ++i)
{
std::cerr << vertexIdToLabel[path[i]].toStdString();
std::cerr << qPrintable(vertexIdToLabel[path[i]]);
if (i != path.size() - 1)
{
std::cerr << " -> ";
Expand Down Expand Up @@ -296,7 +296,7 @@ int main(int argc, char** argv)
for(int j=0; j < p->size(); j++)
{
int id = p->at(j);
std::cout << vertexIdToLabel[id].toStdString();
std::cout << qPrintable(vertexIdToLabel[id]);
if (j != p->size() - 1)
{
std::cout << " ";
Expand All @@ -321,7 +321,7 @@ int main(int argc, char** argv)
for(int i=0; i < out.size(); i++)
{
int id = out.at(i);
std::cout << vertexIdToLabel[id].toStdString();
std::cout << qPrintable(vertexIdToLabel[id]);

if (i != out.size() - 1)
{
Expand Down

0 comments on commit fda766e

Please sign in to comment.