Skip to content

Failed build #4

@arti32lehtonen

Description

@arti32lehtonen

The build is causing an error Assets\External\Morpeh.Queries-main\Core\CompiledQuery.cs(64,21): error CS1929: 'Filter.Enumerator' does not contain a definition for 'Dispose' and the best extension method overload 'EntityExtensions.Dispose(Entity)' requires a receiver of type 'Entity'

The code that raise an error - a dispose method for CompiledQuery:

public void Dispose()
{
    if (m_useEntityEnumerator)
    {
        m_entityEnumerator.Dispose();
    }
}

The issue is that Filter.Enumerator in Morpeh has IDisposible interface only inside Unity Editor
https://github.com/scellecs/morpeh/blob/7bcaf7845e667e9aec397ad97911ba2c5a28a296/Scellecs.Morpeh/Core/Filters/Filter.cs#L332

        public struct Enumerator
#if MORPEH_DEBUG
            : IDisposable
#endif

MORPEH_DEBUG is defined in the same file as:
https://github.com/scellecs/morpeh/blob/7bcaf7845e667e9aec397ad97911ba2c5a28a296/Scellecs.Morpeh/Core/Filters/Filter.cs#L1

#if UNITY_EDITOR
#define MORPEH_DEBUG
#endif

My assumption is that the fix is simple - just to wrap m_entityEnumerator.Dispose():

public void Dispose()
{
    if (m_useEntityEnumerator)
    {
        #if UNITY_EDITOR
        m_entityEnumerator.Dispose();
        #endif
    }
}

It worked for me yet, but I'm not a specialist in this package.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions