Setting up custom rendering pipe using HDAdditionalCameraData.customRender

Hi all,
I am new to using SRP and I am having trouble making progress on this. I have succesfully cretaed my own SRP and accessed it from the graphics settings and now I want to switch to using the HDRP for teh main camera and use my custom renderer on a specific camera. I have set its renderpath to custom (I am on 2018.4.12) and am subscribing to HDAdditionalCameraData.customRender from a monobehaviour like this:

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Experimental.Rendering;
using UnityEngine.Experimental.Rendering.HDPipeline;


public class CameraInspector : MonoBehaviour
{
    HDAdditionalCameraData aData;
    CullResults cull;
    Material errorMaterial;

    private void Awake()
    {
        aData = GetComponent<HDAdditionalCameraData>();
        if (aData != null)
        {
            aData.customRender += SimpleRender;
        }
    }

    void SimpleRender(ScriptableRenderContext context, HDCamera HDcamera)
    {
        //renderer stripped down to this message
        UnityEngine.Debug.Log("Entered custom render pipeline");
    }
}

This produces the debug.log message and then a whole slew of internal errors:

Internal error. Trying to destroy object that is already released to pool.
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr)

These errors continue to sporadically accumulate even after exiting play mode and then the editor crashes. Any help regarding what I am screwing up here is much appreciated.

@Julien_Unity @SebLagarde
Any suggestions on this?

Well, after poking around in the dark for a while it seems the right advice is “don’t use HDRP on 2018.4 because it is completely broken”