godot-sqlite icon indicating copy to clipboard operation
godot-sqlite copied to clipboard

Breakpoint crashes after closing database/db.close()

Open Terria-K opened this issue 3 years ago • 1 comments

Environment:

  • OS: Windows
  • Godot version: 3.4 Stable
  • godot-sqlite version: 3.0-assetlib

Issue description: I'm trying to use breakpoint after I call a function with db.close() inside of it. But whenever that function was called and breakpoint has reached. The game window just crashes instead of just staying. It didn't gave me an information of an object on the debugger as well.

Steps to reproduce:

  1. Create a function with db.close() inside of it.
  2. Put the function in the _ready() function and put a breakpoint below of the function.
  3. Start the scene and wait for it.

Expected Result: The game will stop when the breakpoint has reached and will give you an information of an object on the debugger, but it will not close the window. Actual Result: The game will stop but with some crashing noise, and will closed the window when the breakpoint has reached. It will not give you an information of an object on the debugger.

Minimal reproduction project:

const SQLITE := preload("res://addons/godot-sqlite/bin/gdsqlite.gdns")

var db
var db_name := "test"

func _ready() -> void:
read_from_db()
print("Put a breakpoint here")

func read_from_db():
db = SQLITE.new()
db.path = db_name
db.open_db()
db.close_db()

Additional context No additional info.

Terria-K avatar Nov 06 '21 15:11 Terria-K

I can replicate the issue on my end... 🤔 Not sure why it is crashing though... I'll have to hook up the VS debugger to see actually what is happening.

Also, the issue might be related to godot-cpp itself and not something I can easily fix in this plugin.

2shady4u avatar Nov 07 '21 09:11 2shady4u