clang-tidy: Avoid potential memory leak in BufferViewManager
[quassel.git] / src / core / corebufferviewmanager.cpp
index 23417c3..87a4192 100644 (file)
@@ -1,5 +1,5 @@
 /***************************************************************************
- *   Copyright (C) 2005-2015 by the Quassel Project                        *
+ *   Copyright (C) 2005-2018 by the Quassel Project                        *
  *   devel@quassel-irc.org                                                 *
  *                                                                         *
  *   This program is free software; you can redistribute it and/or modify  *
@@ -74,8 +74,7 @@ void CoreBufferViewManager::requestCreateBufferView(const QVariantMap &propertie
     }
     maxId++;
 
-    CoreBufferViewConfig *config = new CoreBufferViewConfig(maxId, properties);
-    addBufferViewConfig(config);
+    addBufferViewConfig(new CoreBufferViewConfig(maxId, properties, this));
 }