Merge pull request #39 from WebFreak001/fix-ctors

Fix destructors on uninitialized structs
This commit is contained in:
Jan Jurzitza 2018-08-18 20:56:07 +02:00 committed by GitHub
commit c4de569809
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -717,6 +717,7 @@ struct Message {
dbus_message_unref(msg);
}
/// Creates a new iterator and puts in the arguments for calling a method.
void build(TS...)(TS args)
if (allCanDBus!TS) {
DBusMessageIter iter;
@ -793,6 +794,7 @@ struct Message {
}
}
///
unittest {
import dunit.toolkit;
@ -811,12 +813,17 @@ struct Connection {
}
~this() {
if (conn) {
dbus_connection_unref(conn);
conn = null;
}
}
void close() {
if (conn) {
dbus_connection_close(conn);
}
}
void send(Message msg) {
dbus_connection_send(conn, msg.msg, null);