0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2025-03-24 02:10:28 +01:00

modules: Move magick out of media; hold instance from media.

This commit is contained in:
Jason Volk 2019-07-25 21:02:48 -07:00
parent 7b8dfb88f4
commit 3121dc30df
5 changed files with 22 additions and 20 deletions

View file

@ -234,7 +234,6 @@ ircd::m::module_names
"key_server",
"identity_pubkey",
"identity_v1",
"media_magick",
"media_media",
"m_command",
"m_control",

View file

@ -78,6 +78,19 @@ module_LTLIBRARIES = \
well_known.la \
###
#
# {Image|Graphics}Magick Support
#
if IMAGEMAGICK
magick_la_SOURCES = magick.cc
magick_la_CPPFLAGS = $(AM_CPPFLAGS) @IMAGEMAGICK_CPPFLAGS@
magick_la_LDFLAGS = $(AM_LDFLAGS) @IMAGEMAGICK_LDFLAGS@
magick_la_LIBADD = $(AM_LIBS) @IMAGEMAGICK_LIBS@
module_LTLIBRARIES += magick.la
endif IMAGEMAGICK
###############################################################################
#
# Messages / protocol
@ -488,24 +501,6 @@ media_module_LTLIBRARIES = \
media/media_media.la \
###
#
# {Image|Graphics}Magick Support
#
if IMAGEMAGICK
media_media_magick_la_SOURCES = \
media/magick.cc \
###
media_media_magick_la_CPPFLAGS = $(AM_CPPFLAGS) @IMAGEMAGICK_CPPFLAGS@
media_media_magick_la_LDFLAGS = $(AM_LDFLAGS) @IMAGEMAGICK_LDFLAGS@
media_media_magick_la_LIBADD = $(AM_LIBS) @IMAGEMAGICK_LIBS@
media_module_LTLIBRARIES += \
media/media_magick.la \
###
endif IMAGEMAGICK
###############################################################################
#
# /_matrix/app/

View file

@ -1,7 +1,7 @@
// Matrix Construct
//
// Copyright (C) Matrix Construct Developers, Authors & Contributors
// Copyright (C) 2016-2018 Jason Volk <jason@zemos.net>
// Copyright (C) 2016-2019 Jason Volk <jason@zemos.net>
//
// Permission to use, copy, modify, and/or distribute this software for any
// purpose with or without fee is hereby granted, provided that the above

View file

@ -24,9 +24,13 @@ IRCD_MODULE
// the database was just loaded to set the cache size.
conf::reset("ircd.media.blocks.cache.size");
conf::reset("ircd.media.blocks.cache_comp.size");
magick_support.reset(new module{"magick"});
},
[] // fini
{
magick_support.reset();
// The database close contains pthread_join()'s within RocksDB which
// deadlock under certain conditions when called during a dlclose()
// (i.e static destruction of this module). Therefor we must manually
@ -145,6 +149,9 @@ media;
decltype(blocks)
blocks;
decltype(magick)
magick;
std::set<m::room::id>
downloading;

View file

@ -20,6 +20,7 @@ extern const db::descriptor media_blocks_descriptor;
extern const db::description media_description;
extern std::shared_ptr<db::database> media;
extern db::column blocks;
extern std::unique_ptr<module> magick_support;
extern "C" m::room::id
file_room_id(m::room::id::buf &out,