src/main.cc

changeset 768
29e6c5552388
parent 757
8ab9fa53142b
child 769
8bb3bed44570
--- a/src/main.cc	Mon May 05 17:18:01 2014 +0300
+++ b/src/main.cc	Fri May 09 12:06:56 2014 +0300
@@ -43,6 +43,12 @@
 
 CFGENTRY (Bool, firstStart, true);
 
+static void deleteline (LDLine* obj)
+{
+	fprintf (stderr, "delete %p\n", obj);
+	delete obj;
+}
+
 // =============================================================================
 //
 int main (int argc, char* argv[])
@@ -68,7 +74,15 @@
 	initColors();
 	MainWindow* win = new MainWindow;
 	newFile();
-	win->show();
+	//win->show();
+
+	QSharedPointer<LDLine> obj (new LDLine, &deleteline);
+	fprint (stderr, "%1: %2\n", obj.data(), obj->type());
+	//class A { public: virtual ~A(){} virtual int foo() = 0; void destroy() { delete this; }};
+	//class B : public A { public: virtual ~B(){} virtual int foo() override { return 5; }};
+	//QSharedPointer<A> a (new B, [](A* p) { p->destroy(); });
+	//fprintf (stderr, "%p (%lu bytes)\n", a.data(), sizeof *a);
+	exit (0);
 
 	// If this is the first start, get the user to configuration. Especially point
 	// them to the profile tab, it's the most important form to fill in.

mercurial