random crash when breaking constraints

Issue #9 new
Antoine Chalons created an issue

both on Windows and Linux, when the SQL command sent breaks the database’s constraint, we get a LabVIEW crash

we get this both in built app and source code

Comments (5)

  1. James Powell repo owner

    Sorry about that. I made a classic LabVIEW-programmer-working-with-C mistake of assuming a dead refnum is harmless. A dead pointer in a C dll is not harmless, and can’t be safely acted on.

    Another possible fix is to return a default PQ Result Object after calling the Clear.vi. The default Object has a zero-value “null” pointer, and so is safe. But your method (of leaving it undestroyed) is fine.

  2. James Powell repo owner

    BTW, kudo this Idea, as it would allow a much safer way of wrapping pointer-based dlls like this: with a DVR wrapper that has a cleanup callback. That would make the PQ objects behave like other LabVIEW Refnums.

  3. Log in to comment